import sequtils,strutils,algorithm var N = stdin.readline.parseInt P = newSeq[int64](0) ans = newSeq[int64](0) if N == 1: echo 1 else: var b = 100000 while P.len < 6: b += 1 var f = false for i in 2..10000: if b mod i == 0: f = true break if not f: P.add(b.int64) var cnt = 1 for i in 0..5: for j in 0..i: cnt += 1 ans.add(P[i] * P[j]) ans.sort() echo ans[N - 2]