#include <bits/stdc++.h>
using namespace std;
long long stoll(string target) {
  stringstream s;
  s << target;
  long long w;
  s >> w;
  return w;
}
int stoi(string target) {
  stringstream s;
  s << target;
  int w;
  s >> w;
  return w;
}
string itos(int i) {
  stringstream s;
  s << i;
  return s.str();
}
string lltos(long long i) {
  stringstream s;
  s << i;
  return s.str();
}
vector<int> pecati;
int main() {
  ios::sync_with_stdio(false);
  bool ok = true, final = false;
  int i, j, k, n, m;
  int t;
  int br = 0, odgovor = 0, pom = 0, mom = 0, g = 0, f = 0, pamti = 0;
  cin >> n;
  bool b[10000];
  memset((b), (false), sizeof((b)));
  int c[10001];
  memset((c), (0), sizeof((c)));
  for (i = 2; i <= (int)(n); i++) {
    br = i;
    for (j = 2; j <= (int)(i); j++) {
      while (br % j == 0 && br > 1) {
        c[i]++;
        br /= j;
      }
    }
  }
  for (i = 2; i <= (int)(n); i++)
    if (c[i]) {
      pecati.push_back(i);
      for (j = i + i; j <= n; j += i) c[j]--;
    }
  cout << pecati.size() << endl;
  for (i = 0; i < (int)(pecati.size()); i++) cout << pecati[i] << " ";
  return 0;
}
