vault-cracker

Description
Blithchron is the annual cultural festival of IIT Gandhinagar. A popular event in Blithchron is Adrenaline - a treasure hunt. At a particular stage in Adrenaline, the contestants will come to a vault, whose combination can be deciphered only using the previous clue. The previous clue contains one small word W, and a large (meaningless) string of characters S. The combination to open the vault (N) is the number of times W appears in S such that the characters of the W are in the same order. There may be other characters of S interspersed
between them.

Design a program that can crack the combination of the vault.

Input Format
First line contains W
Second line contains the meaningless sequence S

Output Format
One line containing the number of times W appears in S

SAMPLE INPUT
COW
CCOOWW

SAMPLE OUTPUT
8

Explanation

W =  COW appears once in S = CWOW, twice in S = CCOW, and eight times in S = CCOOWW

Source: hackerearth | Difficulty: UNKNOWN_DIFFICULTY


Solutions: