#include <bits/stdc++.h>
using namespace std;
const int MN = 1011;
char comp[MN];
int prime[MN], ans[MN], as, ps;
int n;
int main() {
  for (int i = 2; i < MN; i++)
    if (!comp[i]) {
      prime[ps++] = i;
      for (int j = 2 * i; j < MN; j += i) {
        comp[j] = 1;
      }
    }
  scanf("%d", &n);
  for (int i = 0; i < ps; i++) {
    if (prime[i] > n) break;
    for (int aux = prime[i]; aux <= n; aux *= prime[i]) ans[as++] = aux;
  }
  printf("%d\n", as);
  while (as > 0) printf("%d ", ans[--as]);
  printf("\n");
}
