from math import sqrt, ceil def Sieve(n): lst = [True] * (n + 1) S = set() for i in range(2, ceil(sqrt(n)) + 1): if lst[i]: for j in range(2 * i, n + 1, i): lst[j] = False for i in range(2, n + 1): if lst[i]: S.add(i) return S N = int(input()) mod = 998244353 L = [0] * N ans = 1 for now in Sieve(N - 1): p = now cnt = 0 maxv = 0 while p <= N - 1: if p > N - 1: break cnt += 1 for i in range(p, N, p): L[i] = cnt maxv = max(maxv, L[i] + L[N - i]) p *= now ans *= pow(now, maxv, mod) ans %= mod for i in range(now, N, now): L[i] = 0 print(ans)