#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> vc;
  int cnt = 0;
  bool arr[10001] = {false, false, true, true};
  for (int i = 2; i <= n; i++) {
    int v = i;
    bool flag = true;
    for (int j = 2; j * j <= v; j++) {
      if (v % j == 0) {
        int tochk = 1;
        while (v % j == 0) {
          tochk *= j;
          v /= j;
        }
        flag &= arr[tochk];
      }
    }
    if (v > 1) {
      flag &= arr[v];
    }
    if (!flag || i == 2 || i == 3) {
      vc.push_back(i);
      cnt++;
      arr[i] = true;
    }
  }
  cout << cnt << "\n";
  for (int i = 1; i <= cnt; i++) {
    cout << vc[i - 1] << " ";
  }
  cout << "\n";
  return 0;
}
