import math def main(): n = int(input()) a = [1] for i in range(100001, 500000): flg = True for j in (2,math.sqrt(i) + 1): if i % j == 0: flg = False break if flg: a.append(i * i) a.sort() print(a[n - 1]) main()