## https://yukicoder.me/problems/no/2940 MOD = 998244353 def main(): N = int(input()) inv2 = pow(2, MOD - 2, MOD) answer = 0 for j in range(1, N + 1): n = N // j n_tot = (n * (n - 1)) % MOD n_tot *= inv2 n_tot %= MOD x = (n + (j * n_tot) % MOD) % MOD m = N % j x += (n * m) % MOD x %= MOD answer += x answer %= MOD print(answer) if __name__ == "__main__": main()