#include <bits/stdc++.h>
using namespace std;
const int N = 1111;
bool prime[N];
int ans[N];
void sieve() {
  memset(prime, true, sizeof(prime));
  prime[0] = prime[1] = false;
  for (int i = 2; i < N; i++)
    if (prime[i]) {
      for (int j = i * i; j < N; j += i) prime[j] = false;
    }
}
int main() {
  sieve();
  int n, k = 0;
  scanf("%d", &n);
  int j = 2;
  while (j <= n) {
    if (prime[j]) {
      ans[k++] = j;
      int p = j * j;
      while (p <= n) {
        ans[k++] = p;
        p *= j;
      }
    }
    j++;
  }
  printf("%d\n", k);
  for (int i = 0; i < k; i++) {
    if (i) printf(" ");
    printf("%d", ans[i]);
  }
  printf("\n");
  return 0;
}
