import sys # sys.setrecursionlimit(200005) int1 = lambda x: int(x)-1 pDB = lambda *x: print(*x, end="\n", file=sys.stderr) p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr) def II(): return int(sys.stdin.readline()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def LI1(): return list(map(int1, sys.stdin.readline().split())) def LLI1(rows_number): return [LI1() for _ in range(rows_number)] def SI(): return sys.stdin.readline().rstrip() dij = [(0, 1), (-1, 0), (0, -1), (1, 0)] # dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)] inf = (1 << 63)-1 # inf = (1 << 31)-1 # md = 10**9+7 md = 998244353 n = II() m = n+230 dp = [[0]*m for _ in range(m)] ss = [[0]*(m+1) for _ in range(m)] dp[0][0] = 1 ss[0] = [0]+[1]*m for t in range(n): ndp = [[0]*m for _ in range(m)] nss = [[0]*(m+1) for _ in range(m)] for i in range(1, m): for j in range(1, m): # ndp[i][j] += sum(dp[i-2][j-1, j-9]) l, pi = max(0, j-9), i-2+(t == 0) if pi >= 0: ndp[i][j] += ss[pi][j]-ss[pi][l] # ndp[i][j] += sum(dp[i-3][j-10, j-99]) l, pi = max(0, j-99), i-3+(t == 0) if pi >= 0 and j-9>=0: ndp[i][j] += ss[pi][j-9]-ss[pi][l] # ndp[i][j] += sum(dp[i-4][j-100, j-999]) l, pi = max(0, j-999), i-4+(t == 0) if pi >= 0 and j-99>=0: ndp[i][j] += ss[pi][j-99]-ss[pi][l] nss[i][j+1] = (nss[i][j]+ndp[i][j])%md dp,ss=ndp,nss # p2D(dp) ans=0 for i in range(m): # print(i,dp[i][i]) ans+=dp[i][i] ans%=md print(ans)