A newspaper is published in Walrusland. Its heading is *s*<sub class="lower-index">1</sub>, 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*<sub class="lower-index">2</sub>. 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*<sub class="lower-index">1</sub> will Fangy need to glue them, erase several letters and get word *s*<sub class="lower-index">2</sub>?
The input data contain two lines. The first line contain the heading *s*<sub class="lower-index">1</sub>, the second line contains the word *s*<sub class="lower-index">2</sub>. The lines only consist of lowercase Latin letters (1 ≤ |*s*<sub class="lower-index">1</sub>| ≤ 10<sup class="upper-index">4</sup>, 1 ≤ |*s*<sub class="lower-index">2</sub>| ≤ 10<sup class="upper-index">6</sup>).
none
abc
xyz
-1
abcd
dabc
2
ab
babaaab
5
ab
baaabba
6
fbaaigiihhfaahgdbddgeggjdeigfadhfddja
hbghjgijijcdafcbgiedichdeebaddfddb
-1
ibifgcfdbfdhihbifageaaadegbfbhgeebgdgiafgedchdg
dedfebcfdigdefdediigcfcafbhhiacgfbeccfchd
7
fcagdciidcedeaicgfffgjefaefaachfbfj
aiecchjehdgbjfcdjdefgfhiddjajeddiigidaibejabd
11
ehfjaabjfedhddejjfcfijagefhjeahjcddhchahjbagi
fbfdjbjhibjgjgaaajgdbcfdbhjcajcbbieijhcjgajhgaa
10
ifjcedhjhdjhbiaededfefagigggcebfaebf
geibbffgeefbaghdbfidbbhabdbdgej
9
eidfdfbbgjigghaddbjhcbdechecgghjgfjjcajjhaghdhd
fcgecaefhgjjegbhjeaffcabifihhcadaibhi
11
array,build = input(),input()
if len(set(build) - set(array)) == 0:
    papers,myindex,first = 1,0,0
    for c in build:
        try:
            myindex = array.index(c,myindex)
            myindex+= 1
        except ValueError:
            myindex = array.index(c,0) + 1 
            papers+=1
    print(papers)
else: print(-1)