print([7,11,13,17,19,23,29,31,37,41,47,53,61,67,71,73,83,89,97,103,107,113,131,137,149,157][int(input()) - 1])