def IsPrime(n):
d = 2
while d * d <= n and n % d != 0:
d += 1
return d * d > n
check = False
n = int(input())
i = 1
s = 0
numbers = []
while s < n:
i += 1
if IsPrime(i):
numbers.append(i)
s += 1
else:
continue
print(numbers[n - 1])