//solve atcoder problem //memo:for (const auto &e : e) { #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define foreach(e, m) for (const auto &(e) : (m)) #define ll long long #define ldf long double #define flout std::fixed << std::setprecision(15) << #define txt freopen("wormsort.in", "r", stdin), freopen("wormsort.out", "w", stdout); #define dmap unordered_map #define dmin(x) *min_element(begin(x), end(x)) #define dmax(x) *max_element(begin(x), end(x)) #define huge 4e18 #define intbig (ll)2e9 #define vec2(t) vector> #define vec3(t) vector>> #define bit(x) (1LL << (x)) #define r_up(x, y) (((x) + (y) - 1) / (y)) #define jun_end(a) } while (next_permutation(a.begin(), a.end())); #define pll pair // #define __popcnt __builtin_popcount // #define __popcnt64 __builtin_popcountll #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; const ll MOD = 1e9 + 7; const ll MOD9 = 998244353; vector inp() { string input;getline(cin,input);stringstream ss(input);vector result;ll number;while(ss >> number) { result.push_back(number); }return result; } map tally(vector& a) { map h;for(ll i = 0; i < a.size(); i++) { h[a[i]]++; }return h; } ll gcd(ll a,ll b) { if(b == 0) { return a; }return gcd(b,a % b); } ll modpow(ll a,ll n,ll mod) { ll res = 1;while(n > 0) { if(n & 1) { res = res * a % mod; }a = a * a % mod;n >>= 1; }return res; } ll lcm(ll a,ll b) { return a / gcd(a,b) * b; } ll kaijo(ll n,ll mod) { ll res = 1;for(ll i = 1; i <= n; i++) { res *= i;res %= mod; }return res; } ll comb(ll n,ll k,ll mod) { ll res = 1;for(ll i = 1; i <= k; i++) { res *= n - i + 1;res %= mod;res *= modpow(i,mod - 2,mod);res %= mod; }return res; } ll isqrt(ll n,bool f = false) { if(n == 1) { return 1; }ll a = sqrtl(n + 1);if(a * a > n) { a--; }if(f) { if(a * a != n) { return a + 1; } }return a; } template TTM sum(vector a) { TTM sum = 0;for(ll i = 0; i < a.size(); i++) { sum += a[i]; }return sum; } vector> matrix_mul(vector>& a,vector>& b,ll mod) { ll n = a.size();ll m = a[0].size();ll l = b[0].size();vector> c(n,vector(l,0));for(ll i = 0; i < n; i++) { for(ll j = 0; j < l; j++) { for(ll k = 0; k < m; k++) { c[i][j] += a[i][k] * b[k][j];c[i][j] %= mod; } } }return c; } vector inpf() { string input;getline(cin,input);stringstream ss(input);vector result;ldf number;while(ss >> number) { result.push_back(number); }return result; } ll s_maxop(ll a,ll b) { return max(b,a); } ll s_maxe() { return 0; } template vector csum(vector& a,bool f = false) { vector res(a.size() + 1,0);for(ll i = 0; i < a.size(); i++) { res[i + 1] = res[i] + a[i]; }if(f) { res.erase(res.begin()); }return res; } template vector colum(vector>& a,ll col) { ll n = a.size();vector res(0);for(ll i = 0; i < n; i++) { res.push_back(res[i][col]); }return res; } template vector p_col(vector>& a,bool f = true) { ll n = a.size();vector res(0);for(ll i = 0; i < n; i++) { if(f) { res.push_back(a[i].first); } else { res.push_back(a[i].second); } }return res; } /* ll dfs(ll x,ll prev) { rep(i, links[x].size()) { ll y = links[x][i]; if(y == prev) { continue; } dfs(y,x); } return 0LL; } */ ll n,x; vec2(ll) datas; vector> links; // must use int not ll // intを使わないように注意! int main() { ll n; cin >> n; ll ans = 0; rep(j,n + 1) { if(j==0) { continue; } ll len = (n-j+1)/j; if(len > 0) { ans += (1+len)*len/2*j; } ans += (n-j+1-len*j) * (n / j); ans %= 998244353; } cout << ans; return 0; } /*test case 1 2 5 0 5 5 */