#include #include using namespace std; using ll = long long; using namespace atcoder; using mint = modint998244353; int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); ll N; mint S=0, q, r; cin >> N; for (int j=1; j<=N; j++){ //i=kj, kj+1, ... (k+1)j-1はi/j=kでj個 //N=qj+rと表されるなら0,~,(q-1)がj個 //qがr+1個ある q = N/j; r = N%j; S += q*(q-1)/2*j; S += q*(r+1); } cout << S.val() << endl; return 0; }