A newspaper is published in Walrusland. Its heading is $*s*_{1}$, it consists of lowercase Latin letters. Fangy the little walrus wants to buy several such newspapers, cut out their headings, glue them one to another in order to get one big string. After that walrus erase several letters from this string in order to get a new word $*s*_{2}$. It is considered that when Fangy erases some letter, there's no whitespace formed instead of the letter. That is, the string remains unbroken and it still only consists of lowercase Latin letters.
For example, the heading is "abc". If we take two such headings and glue them one to the other one, we get "abcabc". If we erase the letters on positions $1$ and $5$, we get a word "bcac".
Which least number of newspaper headings $*s*_{1}$ will Fangy need to glue them, erase several letters and get word $*s*_{2}$?
Input
The input data contain two lines. The first line contain the heading $*s*_{1}$, the second line contains the word $*s*_{2}$. The lines only consist of lowercase Latin letters ($1 ≤ |*s*_{1}| ≤ 10^{4}, 1 ≤ |*s*_{2}| ≤ 10^{6}$).
Output
If it is impossible to get the word $*s*_{2}$ in the above-described manner, print "-1" (without the quotes). Otherwise, print the least number of newspaper headings $*s*_{1}$, which Fangy will need to receive the word $*s*_{2}$.
样例
abc
xyz
-1
abcd
dabc
2
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。