#include <bits/stdc++.h>
using namespace std;
map<long long, int> trial_division1(long long n) {
  map<long long, int> p;
  for (long long d = 2; d * d <= n; d++) {
    while (n % d == 0) {
      p[d]++;
      n /= d;
    }
  }
  if (n > 1) p[n]++;
  return p;
}
map<long long, int> m;
int main() {
  ios_base::sync_with_stdio(), cout.tie(NULL), cin.tie(NULL);
  ;
  long long n;
  cin >> n;
  std::vector<int> ans;
  for (int i = 2; i <= n; i++) {
    map<long long, int> v = trial_division1(i);
    bool f = true;
    for (auto x : v) {
      if (v[x.first] > m[x.first]) {
        f = false;
      }
      m[x.first] += max(v[x.first] - m[x.first], 0);
    }
    if (!f) ans.push_back(i);
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
