#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 0;
    return 0;
  }
  vector<bool> is_prime(n + 1, true);
  vector<int> pm;
  is_prime[0] = is_prime[1] = false;
  for (int i = 2; i <= n; i++) {
    if (is_prime[i]) {
      pm.push_back(i);
      for (int j = i * i; j <= n; j += i) is_prime[j] = false;
    }
  }
  vector<int> ans;
  int i = 0;
  while (pm[i] <= n && i < pm.size()) {
    int f = pm[i];
    while (f <= n) {
      ans.push_back(f);
      f *= pm[i];
    }
    i++;
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << " ";
  }
}
