#include using namespace std; constexpr int mod = 998244353; vector> Mul(vector> A,vector> B) { vector>ans(A.size(),vector(A.size())); for(int i = 0; i < A.size(); i++) { for(int j = 0; j < A.size(); j++) { for(int k = 0; k < A.size(); k++) { ans[i][j] += A[i][k]*B[k][j]%mod; if(ans[i][j] >= mod) ans[i][j] -= mod; } } } return ans; } vector> Pow(vector> A,long long B) { vector>ans(A.size(),vector(A.size())); ans[0][0] = 1; while (B) { if(1 & B) { ans = Mul(ans,A); } A = Mul(A,A); B /= 2; } return ans; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); long long N; cin >> N; vector>tmp(2,vector(2)); tmp[0][0] = 1; tmp[0][1] = 1; tmp[1][0] = 1; tmp = Pow(tmp,N-1); cout << (tmp[0][0]+tmp[0][1]+mod-1)%mod << endl; }