#include <bits/stdc++.h>
using namespace std;
int primes[2000];
int main() {
  for (int i = 0; i < 2000; i++) primes[i] = 1;
  int n;
  cin >> n;
  primes[0] = primes[1] = 0;
  int pl[700], qs[1000];
  int npl = 0, nq = 0;
  for (int i = 2; i < n + 2; i++) {
    if (primes[i]) {
      pl[npl++] = i;
      for (int j = 2 * i; j < 1001; j += i) primes[j] = 0;
      int t = i;
      while (t <= n) {
        qs[nq++] = t;
        t *= i;
      }
    }
  }
  cout << nq << endl;
  for (int i = 0; i < nq; i++) cout << qs[i] << ' ';
  cout << endl;
  return 0;
}
