#include <bits/stdc++.h>
int main(void) {
  int n, i, j;
  int a;
  int k = 0;
  int count = 0;
  scanf("%d", &n);
  for (i = 0; i < n; n++) {
    scanf("%d", &a);
    for (j = 2; j < a; j++) {
      if (a % j != 0) k++;
    }
    if (k == a - 2) count++;
    k = 0;
  }
  printf("%d", count);
  return 0;
}
