n = int(input()) for i in range(1,n+1): l = [] for j in range(1,i+1): if i % j == 0: l.append(j) else: pass if len(l) == n-1: ans = i % 998244353 print(ans) exit() else: pass