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