#include <bits/stdc++.h>
using namespace std;
bitset<1000001> bs;
vector<int> primes;
void sieve(long long upperbound);
int main() {
  sieve(1000);
  int n;
  scanf("%d", &n);
  vector<int> ans;
  for (int i = 0; i < primes.size(); ++i) {
    if (primes[i] <= n) {
      ans.push_back(primes[i]);
      int temp = primes[i];
      while (temp * primes[i] <= n) temp *= primes[i], ans.push_back(temp);
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); ++i) {
    if (i > 0) cout << " ";
    cout << ans[i];
  }
  return 0;
}
void sieve(long long upperbound) {
  bs.set();
  bs[0] = bs[1] = 0;
  for (long long j = 2 * 2; j <= upperbound; j += 2) bs[j] = 0;
  primes.push_back(2);
  for (long long i = 3; i <= upperbound; ++i) {
    if (bs[i]) {
      for (long long j = i * i; j <= upperbound; j += 2 * i) {
        bs[j] = 0;
      }
      primes.push_back((int)i);
    }
  }
}
