DDR3#2772

DDR3

0.1 seconds
64 megabytes
Very hard

At a factory producing DDR3 memory modules, daily production is automatically recorded: the computer logs the serial numbers of the modules produced each day, consecutively numbering them from up to the last module of the day. However, due to a programmer's mistake, a failure occurred. Instead of outputting the sequence of consecutive numbers, the program produced a sequence of digits, with no spaces, and whenever two or more identical digits appeared in a row, only one was printed.

Help the programmer quickly answer: how many modules were produced in one day? Note that there were no other errors in the program (besides the loss of consecutive identical digits and the omission of spaces).

Input

The program reads a single integer (1 \leq K \leq 10^{18}).

Output

The program outputs a single integer — the number of modules produced in the day.

Examples

Example 1

Loading
Loading

Note

Explanation of the example: In a correctly working system, the record should be

1 2 3 4 5 6 7 8 9 10 11 12

The program produced:

1234567891012, that is digits, with no spaces.