#include<bits/stdc++.h>
using namespace std;
int biaoji=0,fuzhi=0;
bool zhishu(int x){
if(x==0||x==1) return 0;
for(int j=2;j*j<=x;j++){
if(x%j==0){
return 0;
}
}
return 1;
}
int main(){
int L;cin>>L;
for(int i=2;i<=L;i++){
if(zhishu(i)){
biaoji=i+biaoji;
if(biaoji>L){
cout<<fuzhi;
return 0;
}
fuzhi++;
cout<<i<<endl;
}
}
}