#include <bits/stdc++.h>
using namespace std;
bool isPrime[100005];
vector<int> pr, prime;
void seive_N_logN(int N) {
  prime.clear();
  isPrime[1] = true;
  isPrime[0] = true;
  for (int i = 4; i <= N; i = i + 2) isPrime[i] = true;
  for (int i = 3; i * i <= N; i = i + 2)
    if (!isPrime[i])
      for (int j = i * i; j <= N; j += i) isPrime[j] = true;
  for (int i = 2; i <= N; i++) {
    if (!isPrime[i]) prime.push_back(i);
  }
}
int main() {
  vector<int> v;
  int n;
  cin >> n;
  seive_N_logN(n);
  bool flag = true;
  for (int i = 0; i < prime.size(); i++) {
    for (int j = 1;; j++) {
      int tmp = pow(prime[i], j);
      if (tmp <= n) v.push_back(tmp);
      if (tmp > n) break;
    }
  }
  cout << v.size() << endl;
  for (auto i : v) cout << i << " ";
}
