#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> numb;
  for (int i = 2; i <= n; i++) {
    bool kk = true;
    for (int j = 0; j < numb.size(); j++) {
      if (i % numb[j] == 0) {
        int a = numb[j] * numb[j];
        bool bb;
        while (a <= i) {
          if (a == i) {
            bb = true;
          } else {
            bb = false;
          }
          a *= numb[j];
        }
        if (bb == false) {
          kk = false;
        }
        break;
      }
    }
    if (kk) {
      numb.push_back(i);
    }
  }
  cout << numb.size() << endl;
  for (int i = 0; i < numb.size(); i++) {
    cout << numb[i] << " ";
  }
  cout << endl;
  return 0;
}
