#include <bits/stdc++.h>
int isprime(int);
int main() {
  int A[100];
  int i, n, count = 0, st;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &A[i]);
  }
  for (i = 1; i <= n; i++) {
    st = isprime(A[i]);
    if (st == 1) count++;
  }
  printf("%d\n", count);
  return 0;
}
int isprime(int x) {
  int i;
  if (x == 2) return 1;
  if (x < 2 || x % 2 == 0) return 0;
  i = 3;
  while (i <= sqrt(x)) {
    if (x % i == 0) return 0;
    i += 2;
  }
  return 1;
}
