Skip to main content

~/algor $ cat contests/round-6/J

J. A digit of the endless line

Problem J ICPC rules 1000 ms 64 MB

All positive integers are written one after another in increasing order with no spaces: 123456789101112131415…. Find digit number of this line (digits are numbered from ).

The line 123456789101112: the numbers 10, 11 and 12 are marked, digit 15 is 2

Input

One positive integer .

Output

One digit — digit number of the line.

Note

Examples

Input #1
15
Output #1
2
Input #2
11
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.