#include <bits/stdc++.h>
using namespace std;
vector<int> V;
const int MAXN = 1111;
int ok[MAXN];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    if (ok[i]) continue;
    for (int j = 2 * i; j <= n; j += i) ok[j] = 1;
    int ii = i;
    while (ii <= n) V.push_back(ii), ii *= i;
  }
  printf("%d\n", V.size());
  for (auto it : V) printf("%d ", it);
  puts("");
}
