#include <bits/stdc++.h>
using namespace std;
int f[1000000], n;
vector<int> sol;
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    if (!f[i]) {
      for (int k = i; k <= n; k *= i) {
        sol.push_back(k);
      }
      for (int j = i; j <= n; j += i) f[j] = 1;
    }
  }
  printf("%d\n", sol.size());
  for (int i = 0; i < sol.size(); i++) {
    if (i) printf(" ");
    printf("%d", sol[i]);
  }
  return 0;
}
