import math a = lambda n:n*a(math.floor(math.sqrt(n))) if n != 1 else 1 o = int(input()) s=0 c=0 while True: c += 1 s += a(c) if c == o: break print(s % 998244353)