#include <bits/stdc++.h>
int main() {
  int n, cnt = 0, k = 0, l = 0;
  scanf("%d", &n);
  int ques[n];
  int prime[n + 1];
  int primes[n + 1];
  unsigned long long int i, j, fact;
  int z = 1;
  for (i = 2; i < n; i++) prime[i] = 1;
  for (i = 2; i <= n; i++) {
    if (prime[i]) {
      for (j = i; i * j <= n; j++) prime[i * j] = 0;
    }
  }
  for (i = 2; i <= n; i++) {
    if (prime[i]) {
      cnt++;
      primes[++k] = i;
    }
  }
  for (i = 1; i <= k; i++) {
    fact = primes[i];
    while ((fact *= primes[i]) <= n) {
      cnt++;
      ques[++l] = fact;
    }
  }
  printf("%d\n", cnt);
  for (i = 1; i <= k; i++) {
    printf("%d ", primes[i]);
  }
  for (i = 1; i <= l; i++) {
    printf("%d ", ques[i]);
  }
}
