#include <bits/stdc++.h>
using namespace std;
set<long long> getFactors(long long n) {
  set<long long> ret;
  long long tmp = n, cnt = 1;
  for (long long i = 2; i * i <= n; i++) {
    long long x = 1;
    while (tmp % i == 0) {
      ret.insert(i);
      tmp /= i;
      ++x;
    }
    cnt *= x;
  }
  if (tmp != 1) {
    ret.insert(tmp);
    cnt *= 2;
  }
  return ret;
}
int main() {
  int n;
  scanf("%d", &n);
  set<long long> st;
  for (int i = 2; i <= n; i++) {
    set<long long> vc = getFactors(i);
    if (vc.size() == 1) vc.insert(i);
    for (long long x : vc) st.insert(x);
  }
  cout << st.size() << endl;
  for (auto &it : st) cout << it << " ";
  return 0;
}
