niz | 프로그래밍의 벗 PivotOJ
PivotOJ

niz

시간 제한: 2000ms메모리 제한: 128MB출처: CHC 2004 Regional Competition - SeniorsBOJ 2154

문제

A sequence of digits is obtained by writing down decimal representations of all integers starting with 1 and continuing up to a certain number N consecutively like this:

12345678910111213141516171819202122 ... etc.

Write a program that will compute the position of the first occurrence of the decimal representation of number N in the sequence.

입력

The first and only line of the input contains the integer N, 1 ≤ N ≤ 100,000.

출력

The first and only line of output should contain the position of the first occurrence of the decimal representation of number N in the sequence.

예제

예제 1

입력
15
출력
20

예제 2

입력
34
출력
3

예제 3

입력
142
출력
73
코드를 제출하려면 로그인하세요.