Under construction

Still being built. Things may change

Concatenating Numbers 1

Interview

Time limit0.15sMemory limit128 MB

Summary
Compute the total digit count when integers from 1 to N are written consecutively without spaces.
Level

Easy2 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

Write the integers from 1 through N in order without spaces. This creates one long number.

1234567891011121314151617181920212223...

Write a program that determines how many digits this number has.

Input

The first line contains an integer N. (1 <= N <= 100,000,000)

Output

Print the number of digits in the constructed number.

Examples3

  1. Example 1

    Input
    5
    
    Expected output
    5
    
  2. Example 2

    Input
    15
    
    Expected output
    21
    
  3. Example 3

    Input
    120
    
    Expected output
    252