#include <bits/stdc++.h>
int main() {
  int n, a, box[1000000], i, j, cnt = 0;
  for (i = 2; i < 1000000; i++) {
    box[i] = 1;
  }
  for (i = 3; i < 1000000 - 1; i++) {
    if (i % 2 == 0) {
      box[i] = 0;
    } else {
      for (j = 3; j <= sqrt(i); j += 2) {
        if (i % j == 0) {
          box[i] = 0;
          break;
        }
      }
    }
  }
  printf("%f\n", sqrt(1000000));
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a);
    if (box[a] == 1) {
      cnt++;
      printf("%d\n", a);
    }
  }
  printf("%d\n", cnt);
  return 0;
}
