N = int(input()) M = 450 mod = 998244353 pre = [0] * (M * M) pre[0] = 1 def f(a, b): return a * M + b for _ in range(N): dp = [0] * (M * M) Ac = [0] * (M * M) for i in range(M): for j in range(M): p = pre[f(i, j)] if i + 1 <= M - 1 and j + 2 <= M - 1: dp[f(i + 1,j + 2)] += p dp[f(i + 1,j + 2)] %= mod if i + 10 <= M - 1 and j + 2 <= M - 1: dp[f(i + 10,j + 2)] -= p dp[f(i + 10,j + 2)] %= mod if i + 10 <= M - 1 and j + 3 <= M - 1: dp[f(i + 10,j + 3)] += p dp[f(i + 10,j + 3)] %= mod if i + 100 <= M - 1 and j + 3 <= M - 1: dp[f(i + 100,j + 3)] -= p dp[f(i + 100,j + 3)] %= mod if i + 100 <= M - 1 and j + 4 <= M - 1: dp[f(i + 100,j + 4)] += p dp[f(i + 100,j + 4)] %= mod # for n in range(1, M): # num = len(str(n)) # if i + n <= M - 1 and j + num + 1 <= M - 1: # dp[f(i + n,j + num + 1] += p # dp[f(i + n,j + num + 1] %= mod for i in range(1, M): for j in range(M): Ac[f(i,j)] = (Ac[f(i-1,j)] + dp[f(i,j)]) % mod Ac, pre = pre, Ac ans = 0 for i in range(M - 1): ans += pre[f(i,i+1)] ans %= mod print(ans)