#abc238c. [abc238_c]digitnum

[abc238_c]digitnum

Problem Statement

Given an integer NN, solve the following problem.

Let f(x)=f(x)= (The number of positive integers at most xx with the same number of digits as xx).
Find f(1)+f(2)+dots+f(N)f(1)+f(2)+\\dots+f(N) modulo 998244353998244353.

Constraints

  • NN is an integer.
  • 1leN<10181 \\le N < 10^{18}

Input

Input is given from Standard Input in the following format:

NN

Output

Print the answer as an integer.


Sample Input 1

16

Sample Output 1

73
  • For a positive integer xx between 11 and 99, the positive integers at most xx with the same number of digits as xx are 1,2,dots,x1,2,\\dots,x.
    • Thus, we have f(1)=1,f(2)=2,...,f(9)=9f(1)=1,f(2)=2,...,f(9)=9.
  • For a positive integer xx between 1010 and 1616, the positive integers at most xx with the same number of digits as xx are 10,11,dots,x10,11,\\dots,x.
    • Thus, we have f(10)=1,f(11)=2,...,f(16)=7f(10)=1,f(11)=2,...,f(16)=7.

The final answer is 7373.


Sample Input 2

238

Sample Output 2

13870

Sample Input 3

999999999999999999

Sample Output 3

762062362

Be sure to find the sum modulo 998244353998244353.