#include <bits/stdc++.h>
using namespace std;
bool is(int n) {
  for (int i = 2; i <= n / 2; ++i)
    if (n % i == 0) return false;
  return true;
}
int main() {
  int n;
  cin >> n;
  vector<int> a;
  for (int i = 2; i <= n; ++i) {
    if (is(i)) {
      int k = i;
      while (k <= n) {
        a.push_back(k);
        k *= i;
      }
    }
  }
  cout << a.size() << endl;
  for (auto x : a) cout << x << ' ';
}
