2772.Vanya and Books

Time Limit: 1s Memory Limit: 256MB

Vanya got an important task - he should enumerate books in the library and label each book with its number. Each of the n books should be assigned with a number from 1 to n. Naturally, distinct books should be assigned distinct numbers.

Vanya wants to know how many digits he will have to write down as he labels the books.

Input Format(From the terminal/stdin)

The first line contains integer n (1 \le n \le 109) - the number of books in the library.

Output Format(To the terminal/stdout)

Print the number of digits needed to number all the books.

Sample Input 1

Copy
13
  \n

Sample Output 1

Copy
17
  \n

Sample Input 2

Copy
4
 \n

Sample Output 2

Copy
4
 \n

Hints

Note to the first test. The books get numbers 1,2,3,4,5,6,7,8,9,10,11,12,13, which totals to 17 digits.

Note to the second sample. The books get numbers 1,2,3,4, which totals to 4 digits.

Submit

请先 登录

© 2025 FAQs