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