#include <bits/stdc++.h>
using namespace std;
int n;
int fact(int a, int b) {
  int s = a;
  for (int i = 2; i <= b; i++) {
    s = s * a;
  }
  return s;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  vector<int> v;
  int s;
  bool b[n + 1];
  memset(b, true, n + 1);
  int p = 2;
  b[1] = false;
  while (p <= n) {
    for (int j = 2; j * p <= n; j++) {
      b[j * p] = false;
    }
    p++;
    while (p <= n && !b[p]) p++;
  }
  for (int i = 2; i <= n; i++) {
    if (b[i]) {
      v.push_back(i);
      int k = i * i;
      while (k <= n) {
        v.push_back(k);
        k = k * i;
      }
    }
  }
  cout << v.size() << endl;
  if (v.size() >= 1) cout << v[0];
  for (int i = 1; i < v.size(); i++) cout << ' ' << v[i];
  return 0;
}
