N=int(input()) mod=998244353 dp=[0]*(N+10) dp[0]=1 for i in range(N): ndp=[0]*(N+2) for j in range(i+2): ndp[j]=25*dp[j]+dp[j-1] ndp[j]%=mod dp=ndp ans=0 for i in range(N+1): ans += dp[i] * (i//3) ans%=mod print(ans)