#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<bool> primes(n + 1, 1);
  primes[0] = primes[1] = 0;
  for (int i = 2; i <= n; ++i) {
    if (!primes[i]) continue;
    for (int j = i * i; j <= n; j += i) primes[j] = 0;
  }
  vector<int> quest;
  for (int i = 2; i <= n; ++i) {
    if (!primes[i]) continue;
    int k = i;
    do {
      quest.push_back(k);
      k *= i;
    } while (k <= n);
  }
  cout << quest.size() << '\n';
  for (int i = 0; i < quest.size(); ++i) cout << quest[i] << " ";
  return 0;
}
