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