l=[-1, 7, 11, 13, 17, 19, 23, 29, 2, 3, 5] print(l[int(input())])