#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
int n, cnt;
int ans[1005];
bool prime(int x) {
  for (int i = 2; i < x; i++)
    if (x % i == 0) return 0;
  return 1;
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    if (!prime(i)) continue;
    int p = i;
    while (p <= n) {
      ans[++cnt] = p;
      p *= i;
    }
  }
  printf("%d\n", cnt);
  for (int i = 1; i < cnt; i++) printf("%d ", ans[i]);
  if (cnt) printf("%d\n", ans[cnt]);
}
