#include <bits/stdc++.h>
int main() {
  int n, i, j, primes[1001], ind = 0, x;
  bool viz[1001] = {0};
  scanf("%d", &n);
  i = 2;
  while (i <= n) {
    if (viz[i] == false) {
      j = i + i;
      while (j <= n) {
        viz[j] = true;
        j = j + i;
      }
    }
    i++;
  }
  for (i = 2; i <= n; i++) {
    if (viz[i] == false) {
      primes[ind] = i;
      ind++;
    }
  }
  j = ind;
  for (i = 0; i < j; i++) {
    x = primes[i];
    x = x * x;
    while (x <= n) {
      primes[ind] = x;
      ind++;
      x = x * primes[i];
    }
  }
  printf("%d\n", ind);
  for (i = 0; i < ind; i++) {
    printf("%d ", primes[i]);
  }
  printf("\n");
}
