Số chữ số

View as PDF

Submit solution

Points: 0.01
Time limit: 1.0s
Memory limit: 64M
Input: stdin
Output: stdout

Authors:
Problem type

Cho 2 số nguyên n, x (Với 0≤x≤9, 1≤n≤10000). Tính số lượng chữ số x trong chữ số n.

Input

Dòng đầu tiên chứa 2 số nguyên n, x (Với 0≤x≤9, 1≤n≤~10^{18}~).

Output

Một dòng duy nhất chứa số lượng chữ số x trong chữ số n.

Examples

Input

3 0

Output

0

Input

19 9

Output

1

Input

1111 1

Output

4

Comments

Please read the guidelines before commenting.


There are no comments at the moment.