#P1836. 数页码

数页码

Description

A book’s page numbers are the consecutive integers from 1n1\sim n: 1,2,3,,n1,2,3,\cdots,n. Please compute the sum of all individual digits across all page numbers; for example, for page 123123, its sum is 1+2+3=6 1+2+3=6.

Input Format

A single integer nn on one line.

Output Format

One line containing the sum of all individual digits.

3456789
96342015 

Hint

Constraints: 1n1091\le n\le 10^9.

Translated by ChatGPT 5