#!/usr/bin/env PyPy3 from collections import Counter, defaultdict, deque import itertools import re import math from functools import reduce import operator import bisect from heapq import * import functools mod=998244353 import sys input=sys.stdin.readline #nCrをmodで割ったあまりを求める def ncr(n, r): if ( r<0 or r>n ): return 0 return g1[n] * g2[r] % mod * g2[n-r] % mod def npr(n, r): if ( r<0 or r>n ): return 0 return g1[n] * g2[n-r] % mod N = 10 ** 4 g1 = [1, 1] # 元テーブル g2 = [1, 1] #逆元テーブル inverse = [0, 1] #逆元テーブル計算用テーブル for i in range( 2, N + 1 ): g1.append( ( g1[-1] * i ) % mod ) inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod ) g2.append( (g2[-1] * inverse[-1]) % mod ) n = int(input()) ans = 0 for ii in range(3): for i in range(n): leng = n - 1 + 2 * i + n - i - ii + 3 * ii tmp = 10 * i + n - i - ii + 100 * ii if tmp > leng: break rem = leng - tmp dp = [[0] * (rem + 1) for _ in range(n+1-i-ii)] dp[0][0] = 1 for j in range(1,n+1-i-ii): cumsum = [0] tmp = 0 for k in range(rem+1): tmp += dp[j-1][k] tmp %= mod cumsum.append(tmp) for k in range(rem+1): dp[j][k] = cumsum[k+1] - cumsum[max(0,k-8)] dp[j][k] %= mod #print(dp) if i + ii != 0: for j in range(rem+1): #print(dp[-1][j] , ncr(i+rem-j-1,i-1) % mod , ncr(n,i) % mod) ans += dp[-1][j] * ncr(i+ii+rem-j-1,i+ii-1) % mod * ncr(n,i) % mod * ncr(n-i,ii) % mod ans %= mod else: ans += dp[-1][-1] print(ans)