Time

12:13:00
23 May 2012
Version for print

Vasya`s arithmetic

   Father once slipped Vasya's task: find the sum of all digits of numbers from 1 to 10n. Vasya, who was fond of mathematics but also in programming, quickly solved the puzzle, but with Vasya's father is now a problem - and how to check the correctness of the answer son?

   Help dad Vasya's solve this puzzle, and then he somehow embarrassed in front of her son because of the inability to verify the answer with his son.


Specifications

   Input

   In single line set to one non-negative integer - 10n. It is known that the length of no more than a 107+1.

   Output

   A single number - the required amount of digits.


Problem information

Time Limit: 2 seconds
Memory Limit: 64 MB
Balls for the passed test: 1
Complexity: 46% 90/167

Example

Example input

100

Example output

901


← Lilavati Problems Vasya`s arithmetic 2 →