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