L = [5, 7, 11, 13, 17, 19, 23, 29, 31, 37] N = int(input()) print(L[N])