#include <bits/stdc++.h>
using namespace std;
int P[1001];
vector<int> p;
int n, u, z;
int main() {
  cin >> n;
  for (int i = 2; i <= n; ++i) {
    if (P[i] == 0) {
      P[i] = i;
      p.push_back(i);
    }
    for (int j = 0; j < (int)p.size() && p[j] <= P[i] && i * p[j] <= n; ++j)
      P[i * p[j]] = p[j];
  }
  for (int i = 0; i < p.size(); i++) {
    u = p[i];
    while (u <= n) {
      P[u] = -1;
      u *= p[i];
      z += 1;
    }
  }
  cout << z << "\n";
  for (int i = 2; i <= n; i++) {
    if (P[i] < 0) {
      cout << i << " ";
    }
  }
  return 0;
}
