#include <bits/stdc++.h>
using namespace std;
int ans[1010];
bool isp(int val) {
  int i;
  if (val == 1) return 0;
  for (i = 2; i * i <= val; i++) {
    if (val % i == 0) return 0;
  }
  return 1;
}
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    int i;
    int l = 0;
    if (n == 1) {
      printf("0\n");
      continue;
    }
    for (i = 2; i <= n; i++) {
      if (isp(i) == 0) continue;
      int p = i;
      while (p <= n) {
        ans[l] = p;
        l++;
        p *= i;
      }
    }
    printf("%d\n", l);
    for (i = 0; i < l - 1; i++) printf("%d ", ans[i]);
    printf("%d\n", ans[i]);
  }
  return 0;
}
