n = int(input()) if n == 1: print(1) exit() n -= 1 IsPrime = [True for _ in range(10**6 + 1)] IsPrime[0] = IsPrime[1] = False for i in range(2, 10**6 + 1): if IsPrime[i]: for j in range(i + i, 10**6 + 1, i): IsPrime[j] = False for i in range(10**5 + 1, 10**6 + 1): if IsPrime[i]: n -= 1 if n == 0: print(i * i) break