#include <bits/stdc++.h>
using namespace std;
int is[100005];
int p[100005];
int phi[100005];
int d[100005];
int num[100005];
int ls = 0;
int n;
void pr(int n) {
  memset(is, 0, sizeof(is));
  phi[1] = 1;
  is[1] = 1;
  d[1] = 1;
  num[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (!is[i]) {
      p[++ls] = i;
      d[i] = 2;
      num[i] = 1;
      phi[i] = i - 1;
    }
    for (int j = 1; j <= ls; j++) {
      if (p[j] * i > n) break;
      is[p[j] * i] = 1;
      phi[i * p[j]] = phi[i] * (i % p[j] ? p[j] - 1 : p[j]);
      d[i * p[j]] =
          i % p[j] ? d[i] * d[p[j]] : d[i] / (num[i] + 1) * (num[i] + 2);
      num[i * p[j]] = i % p[j] ? 1 : num[i] + 1;
      if (!i % p[j]) break;
    }
  }
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int as[100005], k = 0;
int main() {
  scanf("%d", &n);
  pr(n);
  for (int i = 1; p[i] <= n && i <= ls; i++) {
    int c = p[i];
    while (c <= n) {
      as[++k] = c;
      c *= p[i];
    }
  }
  printf("%d\n", k);
  for (int i = 1; i <= k; i++) printf("%d ", as[i]);
}
