atcoder#ABC233E. [ABC233E] Σ[k=0..10^100] floor(X/10^k)

[ABC233E] Σ[k=0..10^100] floor(X/10^k)

Score : 500500 points

Problem Statement

Find $\displaystyle \sum_{k=0}^{10^{100}} \left \lfloor \frac{X}{10^k} \right \rfloor$.

Notes

A\lfloor A \rfloor denotes the value of AA truncated to an integer.

Constraints

  • XX is an integer.
  • 1X<105000001 \le X < 10^{500000}

Input

Input is given from Standard Input in the following format:

XX

Output

Print the answer as an integer. Here, the answer must be precisely printed as an integer, even if it is large. It is not allowed to use exponential notation, such as 2.33e+21, or print unnecessary leading zeros, as in 0523.

1225
1360

The value we seek is 1225+122+12+1+0+0++0=13601225+122+12+1+0+0+\dots+0=1360.

99999
111105

Beware of carries.

314159265358979323846264338327950288419716939937510
349065850398865915384738153697722542688574377708317

The values in input and output can both be enormous.