#include <bits/stdc++.h>
using namespace std;
bool cc(int x) {
  for (int i = 2; i * i <= x; i++)
    if (x % i == 0 && x != 2) return false;
  return true;
}
int pow(int i, int j) {
  int x = 1;
  while (j--) {
    x *= i;
  }
  return x;
}
int main() {
  vector<int> v;
  int n;
  cin >> n;
  int c = 0;
  for (int i = 2; i <= n; i++) {
    if (cc(i)) {
      for (int j = 1; pow(i, j) <= n; j++) {
        v.push_back(pow(i, j));
      }
    }
  }
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << endl;
  return 0;
}
