#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define mp make_pair #define pb push_back #define ff first #define ss second #define int64 unsigned long long int a[101]; bool have[1000001]; int main() { ios_base::sync_with_stdio(false); int N; cin >> N; if(N == 1){ cout << 1 << "\n" << 1; return 0; } if(N == 2){ cout << 2 << "\n" << 1 << " " << 2; return 0; } int Sz = 2; a[1] = 1; a[2] = 2; have[1] = have[2] = have[3] = 1; for(int i = 4; i <= N; i++){ if(!have[i]){ a[++Sz] = i; for(int j = 1; j < Sz; j++){ have[a[j] + i] = 1; } } } cout << Sz << "\n"; for(int i = 1; i <= Sz; i++) cout << a[i] << " "; }