#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int sieve[N + 1];
  vector<int> pprimes;
  memset(sieve, 1, sizeof(sieve));
  sieve[0] = sieve[1] = 0;
  for (int i = 2; i < N + 1; i++) {
    if (sieve[i]) {
      for (int j = i * i; j < N + 1; j += i) {
        sieve[j] = 0;
      }
      pprimes.push_back(i);
      for (int k = i * i; k < N + 1; k *= i) {
        pprimes.push_back(k);
      }
    }
  }
  cout << pprimes.size() << endl;
  for (int i = 0; i < pprimes.size(); i++) {
    cout << pprimes[i] << " ";
  }
  cout << endl;
  return 0;
}
