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