#include <bits/stdc++.h>
using namespace std;
long long a[10000], b[10000];
int main() {
  long long n;
  scanf("%lld", &n);
  int i, j;
  a[1] = 1;
  for (i = 2; i <= n; i++) {
    if (a[i] == 0)
      for (j = i * i; j <= 10000; j += i) {
        a[j] = 1;
      }
  }
  int k = 0;
  long long l, c = 0;
  for (i = 1; i <= n; i++)
    if (a[i] == 0) b[k++] = i;
  for (i = 0; i < k; i++)
    for (l = b[i]; l <= n; l *= b[i]) c++;
  printf("%lld\n", c);
  for (i = 0; i < k; i++)
    for (l = b[i]; l <= n; l *= b[i]) printf("%lld ", l);
  return 0;
}
