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