#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int n;
int polje[1005];
int pow(int a, int b) {
  int W = 1;
  for (int i = 0; i < b; i++) W *= a;
  return W;
}
int main(void) {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    if (polje[i]) continue;
    for (int j = 2; i * j <= n; j++) polje[j * i] = 1;
    for (int j = 1; pow(i, j) <= n; j++) v.push_back(pow(i, j));
  }
  printf("%d\n", v.size());
  for (int i = 0; i < v.size(); i++) printf("%d ", v[i]);
  return 0;
}
