n = int(input()) P = 998244353 dp = [0] * n dp[0] = 1 for _ in range(n): nx = [0] * n for i in range(n): for j in range(1,10): if i + j - 1 < n: nx[i + j - 1] += dp[i] for j in range(10,100): if i + j - 2 < n: nx[i + j - 2] += dp[i] for j in range(100,230): if i + j - 3 < n: nx[i + j - 3] += dp[i] for i in range(n): nx[i] %= P dp = nx print(dp[n - 1])