#include <bits/stdc++.h>
using namespace std;
long long pr[1002];
int32_t main() {
  long long n, c = 0;
  cin >> n;
  for (long long t = 2; t <= n; t++) {
    long long i = t;
    c = 0;
    while (i % 2 == 0) {
      c++;
      i /= 2;
    }
    pr[2] = max(pr[2], c);
    for (long long j = 3; j <= sqrt(i); j++) {
      c = 0;
      while (i % j == 0) {
        i /= j;
        c++;
      }
      pr[j] = max(pr[j], c);
    }
    if (i > 1) pr[i] = max(1LL, pr[i]);
  }
  vector<long long> sol;
  for (long long i = 0; i <= n; i++) {
    if (pr[i] == 0) continue;
    long long till = pr[i];
    long long base = i;
    for (long long j = 1; j <= till; j++) {
      sol.push_back(base);
      base *= i;
    }
  }
  cout << sol.size() << "\n";
  for (auto i : sol) cout << i << " ";
}
