#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v;
  int n, a[2005] = {0};
  cin >> n;
  if (n == 1) return cout << 0 << endl, 0;
  for (int i = 2; i <= n; ++i) {
    if (a[i] < 2) v.push_back(i);
    if (a[i]) continue;
    for (int j = i; j <= n; j += i) {
      ++a[j];
    }
  }
  cout << v.size() << endl;
  for (auto i : v) cout << i << " ";
  return 0;
}
