#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5;
long long primes[N];
void seive() {
  fill(primes, primes + N, 1);
  for (long long i = 2; i * i < N; i++) {
    for (long long j = i + i; primes[i] && j < N; j += i) primes[j] = 0;
  }
}
int32_t main() {
  seive();
  long long n;
  cin >> n;
  vector<long long> ans;
  for (long long i = 2; i <= n; i++) {
    if (primes[i]) {
      long long j = 1;
      while (j <= n / i) {
        j *= i;
        ans.push_back(j);
      }
    }
  }
  cout << ans.size() << endl;
  for (auto i : ans) cout << i << " ";
  cout << endl;
  return 0;
}
