#include <bits/stdc++.h>
using namespace std;
int Prime(int tt) {
  int i = 1;
  if (tt == 2) return 1;
  for (i = 2; i * i <= tt; i++) {
    if (tt % i == 0) return 0;
  }
  return 1;
}
int main() {
  int n;
  scanf("%d", &n);
  int num_ans = 0;
  int ans[1050];
  for (int i = 2; i <= n; i++) {
    if (Prime(i)) {
      for (int j = 1;; j++) {
        if ((int)pow((double)i, j) <= n) {
          ans[num_ans++] = (int)pow((double)i, j);
        } else
          break;
      }
    }
  }
  printf("%d\n", num_ans);
  for (int i = 0; i < num_ans; i++) {
    printf("%d ", ans[i]);
  }
  printf("\n");
  return 0;
}
