#include <bits/stdc++.h>
using namespace std;
int n;
void output(vector<int>& ans)
{
cout << (int)ans.size() << endl;
for(auto i: ans)
cout << i << ' ';
cout << endl;
}
int reminder(int i)
{
if (i % 11 == 0) return 11;
else return i % 11;
}
int main()
{
cin >> n;
if (n <= 5)
{
vector<int> ans;
for(int i = 1; i <= 4 && i <= n; ++i)
ans.push_back(i);
output(ans);
return 0;
}
vector<int> ans;
vector<bool> ok(12, 0);
if (n % 11 == 2)//1 2 4 7 10
ok[1] = ok[2] = ok[4] = ok[7] = ok[10] = 1;
else//1 3 4 6 9
ok[1] = ok[3] = ok[4] = ok[6] = ok[9] = 1;
for(int i = 1; i <= n; ++i)
if (ok[reminder(i)])
ans.push_back(i);
output(ans);
return 0;
}