#include <bits/stdc++.h>
int main() {
  int num, i = 1, j, k, count;
  scanf("%d", &num);
  int a[num + 1];
  int b[num];
  for (k = 0; k <= num; k++) a[k] = 0;
  while (i <= num) {
    count = 0;
    for (j = 1; j <= i; j++) {
      if (i % j == 0) count++;
    }
    if (count == 2) a[i] = 1;
    i++;
  }
  int count1 = 0;
  for (i = 0; i <= num; i++) {
    if (a[i] == 1) {
      for (j = i; j <= num; j = j * i) {
        b[count1] = j;
        count1++;
      }
    }
  }
  printf("%d\n", count1);
  for (i = 0; i < count1; i++) printf("%d ", b[i]);
  printf("\n");
  return 0;
}
