9740: ABC196 —— C - Doubled
[Creator : ]
Description
Given is an integer $N$.
How many integers $x$ between $1$ and $N$ (inclusive) satisfy the following condition?
- The decimal representation (without leading zeros) of $x$ has an even number of digits, and its first and second halves are equal as strings.
How many integers $x$ between $1$ and $N$ (inclusive) satisfy the following condition?
- The decimal representation (without leading zeros) of $x$ has an even number of digits, and its first and second halves are equal as strings.
Input
Input is given from Standard Input in the following format:
```
$N$
```
```
$N$
```
Output
Print the answer.
Constraints
- $N$ is an integer.
- $1 ≤ N < 10^{12}$
- $1 ≤ N < 10^{12}$
Sample 1 Input
33
Sample 1 Output
3
Three numbers 11, 22, and 33 satisfy the condition.
Sample 2 Input
1333
Sample 2 Output
13
For example, the decimal representation of 1313 has four digits, and its first and second halves are both 13, so 1313 satisfies the condition.
Sample 3 Input
10000000
Sample 3 Output
999