#C7493. Count of Palindromic Numbers

    ID: 51370 Type: Default 1000ms 256MiB

Count of Palindromic Numbers

Count of Palindromic Numbers

Given two integers A and B, your task is to calculate the number of palindromic numbers in the closed interval \([A, B]\). A palindromic number is one that remains the same when its digits are reversed. In other words, a number \(n\) is palindromic if and only if \(n = reverse(n)\), where the reversal is done by reading the digits from right to left.

The input will be read from standard input and the output should be printed to standard output. Make sure your solution is efficient enough to handle large values of A and B.

inputFormat

The first and only line of input contains two space-separated integers A and B (\(1 \leq A \leq B \leq 10^6\)).

outputFormat

Output a single integer representing the count of palindromic numbers between A and B inclusive.

## sample
1 10
9

</p>