P23725 [AtCoder] [ABC029D] 1
普及+
题目描述

Problem Description

Takahashi wrote down all integers from $1$ to $N$ in decimal notation on paper.
How many times did Takahashi write the digit $1$?

Input Format

The input is given from the standard input in the following format:

$ N $

  • The first line contains an integer $ N $ ($ 1 $ $ ≦ $ $ N $ $ < $ $ 10^9 $).

Output Format

Print the number of times Takahashi wrote the digit $1$ to the standard output, followed by a newline.

Sample Input and Output

Sample Input #1

12

Sample Output #1

5

Sample Input #2

345

Sample Output #2

175

Sample Input #3

999999999

Sample Output #3

900000000

Notes/Hints

Partial Points

This problem has partial points.

  • $20$ points worth of test cases satisfy $ 1 $ $ ≦ $ $ N $ $ ≦ $ $ 999 $.
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
12
样例输出
5