#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  set<int> s;
  for (int i = 2; i <= n; i++) {
    int t = i;
    int x = 2;
    set<int> c;
    while (t > 1) {
      while (t % x == 0) {
        t /= x;
        c.insert(x);
      }
      x++;
    }
    if (c.size() == 1) s.insert(i);
  }
  cout << s.size() << endl;
  for (int i : s) {
    cout << i << " ";
  }
  cout << endl;
  return 0;
}
