#include <bits/stdc++.h>
const double eps = 1e-10;
const double PI = 2.0 * asin(1.0);
using namespace std;
bool prime[1005], ans[1005];
int main(void) {
  int n;
  memset(prime, true, sizeof(prime));
  memset(ans, false, sizeof(ans));
  for (int i = 2; i <= 1000; i++) {
    if (prime[i]) {
      for (int j = i * i; j <= 1000; j += i) prime[j] = false;
    }
  }
  for (int i = 2; i <= 1000; i++) {
    if (prime[i]) {
      for (int j = i; j <= 1000; j *= i) ans[j] = true;
    }
  }
  while (~scanf("%d", &n)) {
    int num = 0;
    for (int i = 2; i <= n; i++) {
      if (ans[i]) num++;
    }
    printf("%d\n", num);
    int mid = 0;
    for (int i = 2; i <= n; i++) {
      if (mid >= num) break;
      if (i == 2)
        printf("2");
      else if (ans[i])
        printf(" %d", i);
    }
    if (num) printf("\n");
  }
  return 0;
}
