#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
const int N = 1e6 + 10;
int n, s;
int x;
bool get(int n)
{
if(n < 2) return false;
for(int i = 2; i <= n / i; i ++)
if(n % i == 0) return false;
}
int main()
{
cin >> n;
for(int i = i; i <= n; i ++)
{
if(s + i > n)
{
cout << x;
return 0;
}
if(get(i))
{
s += i;
cout << i << endl;
x ++;
}
}
return 0;
}