import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(2*10**5+10) write = lambda x: sys.stdout.write(x+"\n") n = int(input()) def hurui(n): pl = [] mpf = [None]*(n+1) for d in range(2,n): if mpf[d] is None: mpf[d] = d pl.append(d) for p in pl: if p*d>n or p>mpf[d]: break mpf[p*d] = p return pl, mpf from collections import defaultdict def factor(num): d = defaultdict(int) if num==1: d.update({1:1}) return d while num>1: d[mpf[num]] += 1 num //= mpf[num] return d ps,mpf = hurui(n+10) for i in range(n, 1, -1): if mpf[i]==i: break ans = 1 M = 998244353 d = defaultdict(int) for j in range(1, n+1): if i==j: continue f = factor(j) for k,v in f.items(): d[k] = max(d[k], v) for k,v in d.items(): ans *= pow(k,v,M) ans %= M print(ans)