#include using namespace std; long long mod = 998244353; //入力が必ず-mod>= 1; } return ret; }; mint &operator=(const mint &b) = default; mint operator-() const {return mint(0)-(*this);} mint operator+(const mint b){return mint(v)+=b;} mint operator-(const mint b){return mint(v)-=b;} mint operator*(const mint b){return mint(v)*=b;} mint operator/(const mint b){return mint(v)/=b;} mint operator+=(const mint b){ v += b.v; if(v >= mod) v -= mod; return *this; } mint operator-=(const mint b){ v -= b.v; if(v < 0) v += mod; return *this; } mint operator*=(const mint b){v = v*b.v%mod; return *this;} mint operator/=(mint b){ if(b == 0) assert(false); int left = mod-2; while(left){if(left&1) *this *= b; b *= b; left >>= 1;} return *this; } mint operator++(int){*this += 1; return *this;} mint operator--(int){*this -= 1; return *this;} bool operator==(const mint b){return v == b.v;} bool operator!=(const mint b){return v != b.v;} bool operator>(const mint b){return v > b.v;} bool operator>=(const mint b){return v >= b.v;} bool operator<(const mint b){return v < b.v;} bool operator<=(const mint b){return v <= b.v;} mint pow(const long long x){return repeat2mint(v,x);} mint inv(){return mint(1)/v;} }; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; int Need = N; vector prime(Need+1,true); prime.at(0) = false; prime.at(1) = false; for(int i=2; i*i<=Need; i++){ if(!prime.at(i)) continue; for(int k=i*i; k<=Need; k+=i) prime.at(k) = false; } vector inv(Need+1,1); for(int i=2; i<=Need; i++) inv.at(i).v = mod-(mod/i*inv.at(mod%i).v %mod); vector> add(2*N); int sum = 0; for(int i=2; i<=N; i++) if(prime.at(i)){ int ap = 0,now = N/i; while(now){ ap += now; now /= i; } sum += ap; for(int k=1; k<=ap; k++) add.at(ap/k).push_back(i); } mint all = 1,answer = 0; vector multi(N+1,1); for(int i=N+N-1; i>0; i--) for(auto p : add.at(i)){ all *= inv.at(multi.at(p)); multi.at(p)++; answer += all*i; all *= multi.at(p); } cout << answer.v << endl; }