Uddered but not Herd (Bronze)#11195

Uddered but not Herd (Bronze)

1 second
128 megabytes
Easy

Little is known about the fact that cows have their own alphabet — cowphabet". It consists of the same letters from 'a' to 'z', but arranged in a different order. To pass the time, Bessie mumbles her cowphabet" over and over again. Farmer John is curious about how many times she has mumbled it.

Given the string of letters that Farmer John heard while Bessie was mumbling, determine the minimum number of times Bessie must mumble the "cowphabet" for Farmer John to hear the given string. Farmer John does not always pay attention to Bessie's mumbling, so he may fail to hear some of the letters. The given string contains only the letters that he heard.

Input

The first line contains lowercase English letters from a' to z' in the order in which they appear in the "cowphabet". The next line contains a string of lowercase English letters that Farmer John heard. The length of this string is between and characters.

Output

Print the minimum number of times Bessie must mumble the "cowphabet".

Examples

In this example, the "cowphabet" is ordered the same way as the regular alphabet.

Bessie must mumble the "cowphabet" at least times. Below, the way Bessie mumbles is shown, with uppercase letters indicating the letters that Farmer John heard.

abcdefghijklMnOpqrstuvwxyz
abcdefghijklmnOpqrstuvwxyz
abcDefghijklmnopqrstuvwxyz

Examples

Example 1

Loading
Loading