While driving to Waterloo, Max sees a car with a phone number on it: XXX 888-7777
.
Then, he wonders
How many numbers are there from
that have consecutive digits that are the same (excluding leading zeros)?
Can you count these numbers for him?
Constraints
Subtask 1 [30%]
Subtask 2 [70%]
No additional constraints.
Input Specification
The first line will contain an integer,
The second line will contain an integer,
Output Specification
Output the count of numbers between
Sample Input 1
Copy
111
2
Sample Output 1
Copy
12
Explanation for Sample 1
The twelve numbers are
Sample Input 2
Copy
9999
2
Sample Output 2
Copy
2619
Sample Input 3
Copy
9000000000000000000
6
Sample Output 3
Copy
1132973828026002
Comments