#include <bits/stdc++.h>
int main(void) {
  int a, n, c = 0, i, j, f, ar;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    f = 1;
    scanf("%d", &a);
    if (a == 2) {
      f = 1;
      goto a;
    }
    ar = sqrt(a);
    if (a % 2 == 0 || a < 2) {
      f = 0;
      goto a;
    }
    for (j = 3; j <= ar; j += 2) {
      if (a % j == 0) {
        f = 0;
        break;
      }
    }
  a:
    if (f) {
      c++;
      printf("aaaaaa%d\n", a);
    }
  }
  printf("%d\n", c);
  return 0;
}
