#include <bits/stdc++.h>
using namespace std;
int n, ans, tg[10005], p[10005];
void prime() {
  memset(p, 0x3f, sizeof(p));
  int i, j;
  p[1] = 0;
  p[2] = 1;
  for (i = 2; i <= 1005; i++) {
    if (!p[i]) continue;
    for (j = i + i; j <= 1005; j = j + i) {
      p[j] = false;
    }
  }
}
int main() {
  prime();
  while (scanf("%d", &n) == 1) {
    memset(tg, 0, sizeof(tg));
    int i;
    ans = 0;
    for (i = 2; i <= n; i++) {
      if (p[i]) {
        int j;
        for (j = i; j <= n; j = j * i) {
          if (!tg[j]) ans++;
          tg[j] = 1;
        }
      }
    }
    cout << ans << endl;
    int first = 1;
    for (i = 2; i <= n; i++) {
      if (tg[i]) {
        if (first) {
          printf("%d", i);
          first = 0;
        } else
          printf(" %d", i);
      }
    }
    if (ans) putchar('\n');
  }
  return 0;
}
