#include <bits/stdc++.h>
const int N = 1000;
bool vis[N + 100];
int v[N + 100];
int top = 0;
int n = 0;
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    if (!vis[i]) {
      vis[i] = true;
      for (int j = 0; j < n; j++) {
        if (!vis[j]) continue;
        if (i * j > n) break;
        if ((j % i == 0) || (i % j == 0)) continue;
        vis[i * j] = true;
      }
      v[top++] = i;
    }
  }
  printf("%d\n", top);
  for (int i = 0; i < top; i++) {
    printf("%d ", v[i]);
  }
  printf("\n");
  return 0;
}
