100 atcoder#ABC152D. [ABC152D] Handstand 2
[ABC152D] Handstand 2
Score : points
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.
25
17
The following pairs satisfy the condition: , , , , , , , , , , , , , , , , and .
1
1
100
108
2020
40812
200000
400000008