100 #ABC196C. [ABC196C] Doubled

[ABC196C] Doubled

Score : 300300 points

Problem Statement

Given is an integer NN. How many integers xx between 11 and NN (inclusive) satisfy the following condition?

  • The decimal representation (without leading zeros) of xx has an even number of digits, and its first and second halves are equal as strings.

Constraints

  • NN is an integer.
  • 1N<10121 \leq N < 10^{12}

Input

Input is given from Standard Input in the following format:

NN

Output

Print the answer.

33
3

Three numbers 1111, 2222, and 3333 satisfy the condition.

1333
13

For example, the decimal representation of 13131313 has four digits, and its first and second halves are both 1313, so 13131313 satisfies the condition.

10000000
999