Tudor is planning a surprise, and needs to buy a cheesecake!
Having bought the cheesecake, Tudor wants to spell a message with the candles. Each candle is shaped in the form of one of the 26 letters of the English alphabet.
Tudor digs around in the DMOJ storage room and finds some candles that he can use. Given the candles he has and the message he wishes to spell, compute the minimum number of candles that Tudor needs to purchase in order to spell the message.
Constraints
In tests worth 5 marks, and .
Input Specification
The input will consist of two lines.
The first line contains the string , the message Tudor wants to spell.
The second line contains the string , the candles Tudor currently has available to him.
These strings will only contain letters from the string ABCDEFGHIJKLMNOPQRSTUVWXYZ
.
Output Specification
Output, on a single line, the number of candles Tudor needs to buy to spell the desired message.
Sample Input
BIRTHDAY
BDAY
Sample Output
4
Sample Explanation
Tudor, not wanting to resort to abbreviations, will need to buy an I
, an R
, a T
, and
an H
in order to properly spell BIRTHDAY
.
Comments