N=int(input()) a=[1] b=10**5 for n in range(b+1,b+21): for i in range(2,n): if n%i==0 and (n not in a) : a.append(n) print(a[N-1])