#include<stdio.h>
int
prime[10000];
bool
mark
[105000
];
int
size;
int
cunsushu(){
int
i,j;
for
(i=0;i<105000;i++){
mark[i]=
false
;
}
size=0;
for
(i=2;i<105000;i++){
if
(size==10000)
break
;
if
(mark[i]==
true
)
continue
;
prime[size++]=i;
if
(i<10000){
for
(
j=i*i
;j<105000;j+=i){
mark[j]=
true
;
}
}
}
return
0;
}
int
main(){
cunsushu();
int
n;
while
(
scanf
(
"%d"
,&n)!=EOF){
int
a=n-1;
printf
(
"%d\n"
,prime[a]);
}
return
0;
}