#include<iostream>
using namespace std;
int main()
{
int L,s=0,gs=0;
cin>>L;
if(L==2)
{
cout<<2<<endl;
gs++;
s+=2;
}
else
{
for(int i=2;i<L;i++)
{
bool bz=true;
for(int j=2;j<i;j++)
{
if(i%j==0)
{
bz=false;
break;
}
}
if(bz==true)
{
cout<<i<<endl;
s+=i;
gs++;
if(s>=L)
{
break;
}
}
}
}
cout<<gs<<endl;
}