#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool isprime[n + 1];
  int j, i;
  memset(isprime, true, sizeof(isprime));
  isprime[0] = isprime[1] = false;
  for (i = 2; i * i <= n; i++) {
    for (j = i * 2; j <= n; j = j + i) {
      isprime[j] = false;
    }
  }
  vector<int> res;
  for (i = 2; i <= n; i++) {
    if (isprime[i]) {
      j = i;
      while (j <= n) {
        res.push_back(j);
        j = j * i;
      }
    }
  }
  cout << res.size() << endl;
  for (int i = 0; i < res.size(); i++) {
    cout << res[i] << " ";
  }
}
