#P1008. Counting Problem I——计数问题 I

Counting Problem I——计数问题 I

Statement

Calculate the total number of occurrences of the digit xx (0x90\le x\le9) among all integers in the interval 11 to nn. For example, in the range of 11 to 1111, that is, among 1,2,3,4,5,6,7,8,9,10,111,2,3,4,5,6,7,8,9,10,11, the digit 11 appears 44 times.

Input

Two integers nn and xx, where 1n1061\le n\le 10^6 and 0x90\le x \le 9, are separated by a single space.

Output

11 integer, representing the number of occurrences of xx.

Samples

11 1
4