#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; const int MOD=998244353; vector> matrixmul(ll m,vector> a,vector> b){ vector> c(m,vector(m,0)); rep(i,m) rep(j,m) rep(k,m) c[i][j]=(c[i][j]+a[i][k]*b[k][j]%MOD)%MOD; return c; } vector> matrixpow(ll m,vector> vec,ll n){ vector> ans(m,vector(m,0)); rep(i,m) ans[i][i]=1; while(n){ if(n&1) ans=matrixmul(m,ans,vec); vec=matrixmul(m,vec,vec); n>>=1; } return ans; } int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); ll n; cin>>n; vector> A(2,vector (2,1)); A[1][1]=0; vector> B=matrixpow(2,A,n-1); cout<<(B[0][0]+B[1][0]-1+MOD)%MOD<