from collections import defaultdict class speedsbunkai: def __init__(self, n): self.num = [-1] * (n + 10) for i in range(2, len(self.num) + 1): if self.num[i - 1] == -1: for j in range(i, len(self.num) + 1, i): if self.num[j - 1] == -1: self.num[j - 1] = i def solve(self,n): ans = [] while n != 1: ans.append(self.num[n - 1]) n //= self.num[n - 1] return ans n=int(input()) s=speedsbunkai(n+5) cnt=[0]*(n+2) for i in range(1,n): d=defaultdict(int) if i!=1: b=s.solve(i) for j in b: d[str(j)]+=1 if i!=n-1: b=s.solve(n-i) for j in b: d[str(j)]+=1 for k in d: cnt[int(k)]=max(cnt[int(k)],d.get(k)) ans=1 mod=998244353 for i in range(n+2): if cnt[i]>0: ans*=pow(i,cnt[i],mod) ans%=mod print(ans)