#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long cl(double a) {
  if (a > (long long)a) {
    return (long long)a + 1;
  } else {
    return (long long)a;
  }
}
long long n;
vector<long long> facts;
const long long M = 1e5 + 1;
bool prime[M];
void seive() {
  for (long long i = 0; i < M; i++) prime[i] = true;
  for (long long p = 2; p * p < M; p++) {
    if (prime[p] == true) {
      for (long long i = p * p; i < M; i += p) {
        prime[i] = false;
      }
    }
  }
}
void solve() {
  for (long long i = 2; i <= n; i++) {
    if (prime[i]) {
      long long curr = i;
      while (curr <= n) {
        facts.push_back(curr);
        curr *= i;
      }
    }
  }
  cout << facts.size() << "\n";
  for (long long i = 0; i < facts.size(); i++) cout << facts[i] << " ";
  cout << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  seive();
  solve();
}
