Skip to main content
LIVE CONTEST: Round #7 · Begin Marathon is live now! …
Problems
#858

~/algor $ cat problems/AqDQOvX0FXb8

A digit of the endless line

Medium 1000 ms 64 MB 59%
Share

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.