パナソニックプログラミングコンテスト(AtCoder Beginner Contest 195)
C
Comma
AtCoder
⌀ 235
原题
← BD →
翻译中…

Problem Statement

翻译中…

When Takahashi writes an integer, he uses a comma every third digit from the right. For example, $1234567$ is written as 1,234,567, and $777$ is written as 777.

翻译中…

How many commas will be used in total when he writes each integer from $1$ through $N$ once?

翻译中…

Constraints

翻译中…
  • $1 \leq N \leq 10^{15}$
  • $N$ is an integer.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N

翻译中…

Output

翻译中…

Print the total number of commas.

翻译中…

样例

Input #1
1010
Output #1
11
No comma is used in writing $999$ or smaller numbers. One comma is used in writing each of the numbers from $1000$ through $1010$. Thus, $11$ commas are used in total.
Input #2
27182818284590
Output #2
107730272137364
题目信息
题号
abc195_c
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。