e-olymp
Competitions

December 2 - BMTK Programming School, Small League

The number of specified digits

Count the number of digits a in number n.

Input

The first line contains one 32-bit integer number n. Number n can be negative. The second line contains a single digit a.

Output

Print the number of digits a in number n.

Time limit 1 second
Memory limit 128 MiB
Input example #1
25557
5
Output example #1
3
Input example #2
100
0
Output example #2
2