import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); long n = Long.parseLong(br.readLine()); br.close(); if (n > 1200000) { return; } int mod = 998244353; long ans = 0; for (long i = 1; i <= n; i++) { long v1 = n / i; long v2 = v1 * (v1 + 1) / 2; long v3 = v2 * i; long v4 = n % i; long v5 = (i - 1 - v4) * v1; ans += v3 - v5; ans %= mod; } System.out.println(ans); } }