#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1010;
int prime[MAXN + 1], flag[1010];
void getPrime() {
  memset(prime, 0, sizeof(prime));
  for (int i = 2; i <= MAXN; i++) {
    if (!prime[i]) prime[++prime[0]] = i;
    for (int j = 1; j <= prime[0] && prime[j] <= MAXN / i; j++) {
      prime[prime[j] * i] = 1;
      if (i % prime[j] == 0) break;
    }
  }
}
void gao() {
  memset(flag, 0, sizeof(flag));
  for (int i = 2; i <= 1000; i++) {
    for (int j = 1; j <= 168; j++) {
      if (i % prime[j] == 0) {
        int nn = i;
        while (nn % prime[j] == 0) nn /= prime[j];
        if (nn == 1) flag[i] = 1;
        break;
      }
    }
  }
}
int main() {
  getPrime();
  gao();
  int n;
  while (scanf("%d", &n) != EOF) {
    int ans = 0;
    for (int i = 2; i <= n; i++)
      if (flag[i]) ans++;
    printf("%d\n", ans);
    for (int i = 2; i <= n; i++)
      if (flag[i]) printf("%d ", i);
    printf("\n");
  }
  return 0;
}
