#include <bits/stdc++.h>
using namespace std;
int i, j, viz[1005], n;
int sol[100005], nrsol;
int main(void) {
  cin >> n;
  for (i = 2; i <= n; ++i)
    if (viz[i] == 0) {
      int nrp = i;
      int put = nrp;
      while (put <= n) {
        sol[++nrsol] = put;
        put *= nrp;
      }
      for (j = 2; j * i <= n; ++j) viz[i * j] = 1;
    }
  cout << nrsol << "\n";
  for (i = 1; i <= nrsol; ++i) cout << sol[i] << " ";
  return 0;
}
