#include #include using namespace std; using namespace atcoder; using ll=int; using ld=long double; ld pie=3.14159265359; ll inf=1001; ll mod=998244353; int main(){ ll n; cin >> n; ll ans=0; vector>>dp(n,vector>(500,vector(500,0))); for (ll i = 1; i < 10; i++) { dp[0][i][1]=1; } for (ll i = 10; i <100; i++) { dp[0][i][2]=1; } for (ll i = 100; i < n; i++) { dp[0][i][3]=1; } for (ll i = 1; i < n; i++) { for (ll j = 0; j < 450; j++) { for (ll k = 0; k < 450; k++) { if (dp[i-1][j][k]==0) { continue; } if (k+2>450) { continue; } for (ll l = 1; l < 10&&l+j<450; l++) { dp[i][j+l][k+2]+=dp[i-1][j][k]; if (dp[i][j+l][k+2]>mod) { dp[i][j+l][k+2]-=mod; } } if (k+3>450) { continue; } for (ll l = 10; l < 100&&l+j<450; l++) { dp[i][j+l][k+3]+=dp[i-1][j][k]; if (dp[i][j+l][k+3]>mod) { dp[i][j+l][k+3]-=mod; } } if (k+3>450) { continue; } for (ll l = 100; l < n&&l+j<450; l++) { dp[i][j+l][k+4]+=dp[i-1][j][k]; if (dp[i][j+l][k+4]>mod) { dp[i][j+l][k+4]-=mod; } } } } } for (ll i = 0; i < 500; i++) { ans+=dp[n-1][i][i]; ans%=mod; } cout << ans << endl; }