#include <bits/stdc++.h>
using namespace std;
int tmp[10000] = {0};
int main() {
  int n;
  scanf("%d", &n);
  int ans = 0;
  for (int i = 2; i <= n; i++) {
    if (tmp[i] == 0) {
      for (int j = i + i; j <= n; j += i) {
        tmp[j]++;
      }
    }
  }
  for (int i = 2; i <= n; i++) {
    if (tmp[i] < 2) {
      ans++;
    }
  }
  printf("%d\n", ans);
  for (int i = 2; i <= n; i++) {
    if (tmp[i] < 2) {
      printf("%d ", i);
    }
  }
  return 0;
}
