#include <bits/stdc++.h>
using namespace std;
bool c[1005];
int q[1005];
int main() {
  int n;
  cin >> n;
  int nq = 0;
  for (int p = 2; p <= n; p++) {
    if (c[p]) continue;
    int pp = p;
    while (pp <= n) q[nq++] = pp, pp *= p;
    for (int m = p; m <= n; m += p) c[m] = 1;
  }
  cout << nq << endl;
  for (int i = 0; i < nq; i++) cout << q[i] << ' ';
  return 0;
}
