#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool fs(T &x) {
  int c = getchar();
  int sgn = 1;
  while (~c && c < '0' || c > '9') {
    if (c == '-') sgn = -1;
    c = getchar();
  }
  for (x = 0; ~c && '0' <= c && c <= '9'; c = getchar()) x = x * 10 + c - '0';
  x *= sgn;
  return ~c;
}
map<vector<int>, int> mp;
vector<int> prime, x, y[1005 + 5];
int ara[1005 + 5], p[1005 + 5] = {0};
int pr() {
  int i, j;
  for (i = 2; i * i <= 1001; i++) {
    if (p[i] == 0) {
      for (j = i + i; j <= 1001; j += i) p[j] = 1;
    }
  }
  for (j = 2; j <= 1001; j++) {
    if (p[j] == 0) prime.push_back(j);
  }
  return 0;
}
int main() {
  pr();
  memset(ara, 0, sizeof(ara));
  int a, b, c, d, e, f, g, h, i, j, n;
  fs(n);
  if (n == 1) {
    printf("0\n");
    return 0;
  }
  int psize = prime.size();
  for (j = 0; prime[j] <= n && j < psize; j++) {
    for (i = prime[j]; i <= n; i *= prime[j]) {
      ara[i] = 1;
    }
  }
  for (i = 2; i <= n; i++) {
    if (ara[i] == 1) {
      x.push_back(i);
    }
  }
  b = x.size();
  printf("%d\n", b);
  for (i = 0; i < b; i++) {
    if (i != 0) printf(" ");
    printf("%d", x[i]);
  }
  printf("\n");
  return 0;
}
