#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 ap(Need+1); vector prime(Need+1,true); prime.at(0) = false; prime.at(1) = false; for(int i=2; i<=Need; i++){ if(!prime.at(i)) continue; ap.at(i)++; for(int k=i+i; k<=Need; k+=i){ prime.at(k) = false; int f = 0,k2 = k; while(k2%i == 0) f++,k2 /= i; ap.at(i) += f; } } 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> D(N+1); for(int i=1; i<=N; i++) for(int k=i; k<=N; k+=i) D.at(k).push_back(i); vector> add(N+N); for(int i=1; i<=N; i++) for(int k=1; k<=ap.at(i); k++) add.at(ap.at(i)/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; }