n = int(input()) # naive assert n <= 10**5 R_i, P_i = 1, 1 MOD = 998244353 for k in range(1, 18): for i in range(max(2, 10**(k-1)), min(10**k, n + 1)): R_i = R_i * (1 + pow(10, P_i + k, MOD)) + i * pow(10, P_i, MOD) R_i = R_i % MOD P_i = (2 * P_i + k) % MOD # <- damenahazu~ print(R_i)