#include <bits/stdc++.h>
int main() {
  int n = 0, primes = 0;
  ;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int num;
    scanf("%d", &num);
    if (!num % 2) {
      continue;
    }
    for (int w = 3; w * w <= num; w += 2) {
      if (!num % w) {
        continue;
      }
    }
    primes++;
  }
  printf("%d", primes);
  return 0;
}
