#include <bits/stdc++.h>
using namespace std;
vector<long long> vect;
void SieveOfEratosthenes(int n) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (int p = 2; p <= n; p++)
    if (prime[p]) vect.push_back(p);
}
int main() {
  long long n, t1, t2, i;
  vector<long long> ans;
  cin >> n;
  SieveOfEratosthenes(n);
  for (i = 0; i < vect.size(); i++) {
    t1 = vect[i];
    t2 = t1;
    while (t2 <= n) {
      ans.push_back(t2);
      t2 *= t1;
    }
  }
  cout << ans.size() << "\n";
  for (i = 0; i < ans.size(); i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
