#include using namespace std; using ll = long long; constexpr int mod = 998244353; int main(void) { ll N; cin >> N; if(N > 2e6) return 1; ll ans = 0; for(ll j = 1; j <= N; ++j) { ans = (ans + (N / j) * (N / j - 1) / 2 * j % mod) % mod; ans = (ans + (N / j) * (N % j + 1) % mod) % mod; } cout << ans << "\n"; return 0; }