#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> v(10000);
  set<long long> s;
  set<long long>::iterator it;
  for (int i = 2; i <= n; i++) {
    if (v[i] == 0) {
      for (int j = i * 2; j <= n; j += i) {
        v[j]++;
      }
    }
  }
  for (int i = 2; i <= n; i++) {
    if (v[i] < 2) s.insert(i);
  }
  cout << s.size() << endl;
  for (it = s.begin(); it != s.end(); it++) {
    cout << *it << " ";
  }
  return 0;
}
