#include #include #define rep(i, n) for (int i = 0; i < n; ++i) typedef long long ll; using namespace atcoder; using namespace std; using mint = modint998244353; template struct mat { vector> M; int H = 0, W = 0; mat(int h, int w) { this->H = h; this->W = w; M = vector>(h, vector(w)); } mat(vector> &v) { this->H = v.size(); this->W = v[0].size(); M = v; } vector operator[](int i) const { return M[i]; } vector &operator[](int i) { return M[i]; } mat operator*(const mat &a) { mat res(H, a.W); rep(i, H) rep(k, W) rep(j, a.W) res[i][j] += M[i][k] * a[k][j]; return res; } mat pow(ll n) { mat res(H, W); rep(i, H) res[i][i] = 1; mat a = *this; while (n) { if (n & 1) res = res * a; a = a * a; n >>= 1; } return res; } }; int main() { cin.tie(0)->sync_with_stdio(0); ll N; cin >> N; vector> A = {{1, 1}, {1, 0}}; mat a(A); mat b = a.pow(N); cout << (b[0][0] - 1).val() << "\n"; return 0; }