#include using namespace std; using ll=long long; #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() template bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;} template bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;} const ll MOD=998244353; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); ll N; cin>>N; if(N>1'200'000)return 0; ll ans=0; for(ll i=1;i<=N;i++){ ll b=(N/i)*i; ans+=(N/i-1)*(N/i)/2%MOD*i+(N-b+1)*(N/i)%MOD; ans%=MOD; } cout<