a = [7, 11, 13, 17, 19, 23, 29, 47, 59, 61, 73, 89] n = int(input()) print(a[n-1])