n = int(input()) nn = 2 * n + 80 dp = [[0] * (nn) for _ in range(nn)] for i in range(nn-1): dp[i+1][len(str(i+1))] += 1 for j in range(1,nn): for i in range(1,nn): dp[i][j] += dp[i-1][j] mod = 998244353 for w in range(n-1): n_dp = [[0] * (nn) for _ in range(nn)] for i in range(1,nn): for j in range(1,nn): if j >= 2: if i - 10 < 0: n_dp[i][j] += dp[i-1][j-2] else: n_dp[i][j] += dp[i-1][j-2] - dp[i-10][j-2] if j >= 3 and i - 10 >= 0: if i - 100 < 0: n_dp[i][j] += dp[i-10][j-3] else: n_dp[i][j] += dp[i-10][j-3] - dp[i-100][j-3] if j >= 4 and i - 100 >= 0: if i - 1000 < 0: n_dp[i][j] += dp[i-100][j-4] else: n_dp[i][j] += dp[i-100][j-4] - dp[i-1000][j-4] n_dp[i][j] %= mod # for e in dp: # print(e) # print() # for e in n_dp: # print(e) if w == n-2:break for j in range(1,nn): for i in range(1,nn): n_dp[i][j] += n_dp[i-1][j] dp = n_dp if n == 1:print(1) else: ans = 0 for i in range(nn): ans += n_dp[i][i] else:print(ans%mod)