#include <bits/stdc++.h>
using namespace std;
int mx = 1001, n;
int vis[1001];
int dp[1001][1001];
vector<int> v;
long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
void solve(int ind, int lc) {
  if (ind > n || lc > n) return;
  int &ret = dp[ind][lc];
  if (ret != 0) return;
  ret = 1;
  solve(ind + 1, lc);
  long long t = lcm(lc, ind);
  if (t != ind && t < mx) vis[t]++;
  solve(ind + 1, t);
}
int main() {
  cin >> n;
  solve(2, 1);
  for (int i = 2; i <= n; i++)
    if (!vis[i]) v.push_back(i);
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << endl;
  return 0;
}
