시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB55848445189.484%

문제

There are many ways to count the frequencies of letters but can they be applied to digits?

Given a range (in the form of two integers) and a digit (0-9), you are to count how many occurrences of the digit there are in the given range.

입력

There is only one input line; it provides the range and the digit. Each integer for the range will be between 1000 and 9999 (inclusive) and the digit will be between 0 and 9 (inclusive). Assume the first integer for the range is not greater than the second integer for the range.

출력

Print the number of occurrences of the digit in the given range.

예제 입력 1

1000 1000 0

예제 출력 1

3

예제 입력 2

1000 1001 0

예제 출력 2

5

예제 입력 3

8996 9004 5

예제 출력 3

0

예제 입력 4

9800 9900 5

예제 출력 4

20