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