#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> prime, ans;
void sieve() {
  vector<bool> chk(n + 10, false);
  prime.emplace_back(2);
  for (int i = 3; i <= n; i += 2) {
    if (!chk[i]) {
      prime.emplace_back(i);
      for (int j = i; j <= n; j += i) chk[j] = true;
    }
  }
}
int main() {
  cin >> n;
  if (n == 1) {
    cout << "0\n";
    return 0;
  }
  sieve();
  for (int p : prime) {
    int tmp = p;
    while (p <= n) {
      ans.emplace_back(p);
      p *= tmp;
    }
  }
  cout << ans.size() << "\n";
  for (int a : ans) cout << a << " ";
}
