#include <bits/stdc++.h>
using namespace std;
bool arr[1000006];
long long tot = 0;
void funn(long long n) {
  for (int i = 2; i * i <= n; i++) {
    if (!arr[i]) {
      for (int j = i * i; j <= n; j += i) {
        arr[j] = true;
      }
    }
  }
}
int main() {
  int n;
  cin >> n;
  funn(n);
  vector<int> x;
  for (int i = 2; i <= n; i++) {
    if (!arr[i]) {
      int r = 1;
      while (r <= n / i) {
        r *= i;
        x.push_back(r);
      }
    }
  }
  cout << x.size() << endl;
  for (vector<int>::iterator j = x.begin(); j != x.end(); j++) {
    cout << *j << " ";
  }
  return 0;
}
