#include <bits/stdc++.h>
using namespace std;
int l,ans=0,c=0;
bool f(int x)
{
if(x==1)
{
return 0;
}
for(int i=2; i*i<=x; i++)
{
if(x%i==0)
{
return 0;
}
}
return 1;
}
int main()
{
cin>>l;
for(int i=2; i<=l; i++)
{
if(ans<=l)
{
if(f(i))
{
ans+=i;
cout<<i<<endl;
c++;
}
}
}
cout<<c;
return 0;
}```