#include <bits/stdc++.h>
using namespace std;
long long isprime[1001] = {0};
void compute() {
  long long i;
  for (i = 2; i < 1001; i++) {
    if (isprime[i] == 0) {
      long long j;
      for (j = i * i; j <= 1000; j += i) isprime[j] = 1;
    }
  }
  for (i = 2; i < 1001; i++) isprime[i] = !isprime[i];
}
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  long long begtime = clock();
  compute();
  long long n;
  cin >> n;
  long long ans = 0;
  vector<long long> v;
  long long i;
  for (i = 2; i < n + 1; i++) {
    if (isprime[i]) {
      long long temp = i;
      while (temp <= n) {
        v.push_back(temp), ans++;
        temp *= i;
      }
    }
  }
  cout << ans << "\n";
  for (i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  long long endtime = clock();
  cerr << endl
       << "Time elapsed: " << (endtime - begtime) * 1000 / CLOCKS_PER_SEC
       << " ms";
  return 0;
}
