def compute_product(i): """Compute product of floor(i^(1/k)) for all k >= 1""" if i == 1: return 1 product = 1 k = 1 # For i <= 10^18, we need at most ~60 iterations while k <= 63: # Binary search for floor(i^(1/k)) low, high = 1, min(i, 10**9) while low < high: mid = (low + high + 1) // 2 if mid ** k <= i: low = mid else: high = mid - 1 kth_root = low if kth_root == 1: # All further roots are 1 break product *= kth_root k += 1 return product def solve(N): MOD = 998244353 result = 0 for i in range(1, N + 1): result = (result + compute_product(i)) % MOD return result N = int(input()) print(solve(N))