#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  vector<long long> dp(n + 1, 0);
  for (long long i = 2; i <= n; i++) {
    if (dp[i] > 0) continue;
    for (long long j = i; j <= n; j += i) {
      dp[j]++;
    }
  }
  vector<long long> res;
  for (long long i = 2; i <= n; i++) {
    if (dp[i] == 1) {
      res.push_back(i);
    }
  }
  cout << res.size() << '\n';
  for (auto t : res) cout << t << " ";
  cout << '\n';
  return 0;
}
