#include <bits/stdc++.h>
using namespace std;
int arr[100010];
int sieve[100010];
int main() {
  int n, i, j, m, x, a, b, ans, q, flag = 0, cnt = 0;
  scanf("%d", &n);
  for (i = 2; i <= n; i++) {
    if (!sieve[i]) {
      for (j = i * i; j <= n; j += i) sieve[j] = 1;
      for (j = i; j <= n; j = j * i) {
        arr[cnt++] = j;
      }
    }
  }
  printf("%d\n", cnt);
  for (i = 0; i < cnt; i++) printf("%d ", arr[i]);
  if (cnt) printf("\n");
  return 0;
}
