import math Q = int(input()) if Q > 1.2 * 10**8: print(0) exit() ans = 0 MOD = 998244353 for N in range(1, Q + 1): sqrtN = math.isqrt(N) c = 0 for i in range(1, sqrtN + 1): c += N // i c %= MOD sqrtN %= MOD ans += 2 * c - (sqrtN * sqrtN) % MOD ans %= MOD print(ans)