#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
template<class T> bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;}
template<class T> bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;}

#include<atcoder/modint>
using mint=atcoder::modint998244353;

void Solve(){
    int N;
    cin>>N;
    vector<mint>cnt(N+1),dp(N+1);
    cnt[0]=1;
    for(int i=0;i<N;i++){
        vector<mint>nxt_cnt(N+1);
        vector<mint>nxt_dp(N+1);
        for(int j=0;j<=N;j++){
            if(j+1<=N){
                nxt_cnt[j+1]+=cnt[j];
                nxt_dp[j+1]+=dp[j];
            }
            if(j-1>=0){
                nxt_cnt[j-1]+=cnt[j];
                nxt_dp[j-1]+=dp[j]+(j-1)*cnt[j];
            }
        }
        swap(cnt,nxt_cnt);
        swap(dp,nxt_dp);
    }
    mint ans=dp[0];
    cout<<ans.val()<<"\n";
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    Solve();
}