l=[100003, 100019, 100043, 100049, 100057, 100069, 100103, 100109, 100129, 100151, 100153, 100169] newlist = set([]) for i in l: for j in l: newlist.add(i*j) newlist.add(1) supernewlist = list(newlist) supernewlist.sort() print(supernewlist[int(input())-1])