#P4681. Vanya and Books

    ID: 2248 传统题 1000ms 256MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>语言入门循环结构基础算法递推CodeForces

Vanya and Books

Vanya and Books

题面翻译

求1-n的正整数一共有多少位.

题目描述

Vanya got an important task — he should enumerate books in the library and label each book with its number. Each of the n n books should be assigned with a number from 1 1 to n 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.

输入格式

The first line contains integer n n ( 1<=n<=109 1<=n<=10^{9} ) — the number of books in the library.

输出格式

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

样例 #1

样例输入 #1

13

样例输出 #1

17

样例 #2

样例输入 #2

4

样例输出 #2

4

提示

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

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