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