#include <bits/stdc++.h>
static inline unsigned long long rdtsc() {
  unsigned long long d;
  __asm__ __volatile__("rdtsc" : "=A"(d));
  return d;
}
using namespace std;
const int inf = (int)1.01e9;
const double eps = 1e-9;
const int M = (int)1e9 + 7;
const int N = (int)3.22e5;
const int maxn = (int)1e5 + 10;
int a[maxn];
int p[maxn];
int main() {
  int n;
  scanf("%d", &n);
  vector<int> v;
  for (int i = 2; i <= n; ++i)
    if (p[i] <= 1) {
      v.push_back(i);
      if (p[i] == 0)
        for (int j = 2 * i; j <= n; j += i) p[j] += 1;
    }
  printf("%d\n", ((int)(v).size()));
  for (int i = 0; (i) < (((int)(v).size())); ++i)
    printf("%d%c", v[i], " \n"[i + 1 == ((int)(v).size())]);
  return 0;
}
