#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int i = 2;
  vector<int> ans;
  while (i <= n) {
    bool ok = 1;
    int k = i;
    for (int j = 2; j * j <= i; ++j) {
      if (i % j == 0) {
        ok = 0;
      }
    }
    if (ok)
      while (k <= n) {
        ans.push_back(k);
        k *= i;
      }
    i++;
  }
  cout << ans.size() << endl;
  for (int j = 0; j < ans.size(); ++j) cout << ans[j] << " ";
  return 0;
}
