#abc152d. [abc152_d]Handstand 2
[abc152_d]Handstand 2
Problem Statement
Given is a positive integer .
Find the number of pairs of positive integers not greater than that satisfy the following condition:
- When and are written in base ten without leading zeros, the last digit of is equal to the first digit of , and the first digit of is equal to the last digit of .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
25
Sample Output 1
17
The following pairs satisfy the condition: , , , , , , , , , , , , , , , , and .
Sample Input 2
1
Sample Output 2
1
Sample Input 3
100
Sample Output 3
108
Sample Input 4
2020
Sample Output 4
40812
Sample Input 5
200000
Sample Output 5
400000008