#include <bits/stdc++.h>
using namespace std;
long long n, q = 1, sz;
int main() {
  cin >> n;
  vector<long long> is_prime(n + 1, true), primes;
  is_prime[0] = is_prime[1] = 0;
  for (int i = 2; i * i <= n; i++)
    if (is_prime[i])
      for (int j = i * i; j <= n; j += i) is_prime[j] = false;
  vector<long long> ans;
  for (int i = 1; i <= n; i++) {
    if (is_prime[i]) {
      q = 1;
      while (q <= n / i) {
        q *= i;
        ans.push_back(q);
      }
    }
  }
  sz = ans.size();
  cout << sz << endl;
  for (int i = 0; i < sz; i++)
    i != sz - 1 ? cout << ans[i] << " " : cout << ans[i] << endl;
  return 0;
}
