N = int(input())
MOD = 998244353
ans = 0
for k in range(1,N+1):
    q = (N+1-k)//k
    r = (N+1-k)%k
    ans = (ans+(k*q*(q+1))//2+(q+1)*r)%MOD
print(ans)