import math

def getprimenum():
    list1=[]
    list1.append(1)
    list1.append(2)
    for i in range(2,100001):
        flag = 0
        for j in range(2,math.ceil(math.sqrt(float(i)))+1):
            if i%j==0:
                flag=1
                break
        if flag==0:
            list1.append(i)
    return list1
list2=getprimenum()

while True:
    try:
        num=int(input())
        if num==1:
            print(2)
            continue
        print(list2[num])
    except EOFError:
        break