#include <bits/stdc++.h>
int main(void) {
  int i, j, k;
  int n, m, p = 0, a[10000] = {0};
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < n; i++) {
    if (a[i] == 2) {
      p++;
    } else if (a[i] % 2 != 0) {
      m = (int)ceil(sqrt(a[i]));
      printf("%d\n", m);
      for (j = 2; j <= m; j++) {
        if (a[i] % j == 0) {
          break;
        } else if (j == m) {
          printf("%d\n", a[i]);
          p++;
        }
      }
    }
  }
  printf("%d\n", p);
  return 0;
}
