#include<bits/stdc++.h>
using namespace std;
int main()
{
int L,ans=0,tot=0;
cin>>L;int mark=0;
for(int i=2;i+tot<=L;i++)
{
for(int j=2;j<i;j++){
if(i%j==0){
mark=1;
break;
}
}
if(mark==0){
if(i+tot<=L){
cout<<i<<endl;
ans++;
tot+=i;
}else{
break;
}
}
}
cout<<ans;
return 0;
}