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