l=[-1, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41] print(l[int(input())])