#include <bits/stdc++.h>
using namespace std;
int main(){
int l,flag=0,i=2,total=0,t=0;
cin>>l;
while(total<=l){
for(int j=2;j<=sqrt(i);j++){
if(i%j==0){
flag++;
}
}
if(flag==0){
cout<<i<<endl;
total+=i;
t++;
}
if(total>l){
break;
}
flag=0;
i++;
}
cout<<t-1;
return 0;
}