#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<bool> markers(n + 1, 1);
  markers[0] = markers[1] = 0;
  for (size_t i = 2; i * i <= n; i++) {
    if (markers[i]) {
      for (size_t j = i * i; j <= n; j += i) {
        markers[j] = 0;
      }
    }
  }
  vector<int> v;
  for (size_t i = 2; i <= n; i++) {
    if (markers[i]) v.push_back(i);
  }
  vector<int> res;
  for (size_t i = 0; i < v.size(); i++) {
    for (size_t j = 1;; j++) {
      int val = pow(v[i], j);
      if (val <= n)
        res.push_back(val);
      else
        break;
    }
  }
  cout << res.size() << '\n';
  for (size_t i = 0; i < res.size(); i++) {
    cout << res[i] << " ";
  }
}
