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