#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
long long pr[1111];
int main() {
  long long n, i, j;
  cin >> n;
  if (n == 1) {
    cout << "0";
    return 0;
  }
  for (i = 1; i <= 1001; i++) {
    for (j = 1; j * i <= 1001; j++) pr[i * j]++;
  }
  for (i = 1; i <= n; i++) {
    if (pr[i] == 2) v.push_back(i);
  }
  for (i = 1; i <= 40; i++) {
    if (pr[i] == 2) {
      j = 2;
      while (pow(i, j) <= n) {
        v.push_back(pow(i, j));
        j++;
      }
    }
  }
  cout << v.size() << endl;
  for (i = 0; i < v.size(); i++) cout << v[i] << " ";
  return 0;
}
