#include <bits/stdc++.h>
int prime(int num) {
  if (num < 2)
    return 0;
  else if (num == 2)
    return 1;
  else if (num % 2 == 0)
    return 0;
  int i;
  for (int i = 3; i * i < num; i += 2) {
    if (num % i == 0) return 0;
  }
  return 1;
}
int main() {
  int n, i, p, count, j;
  count = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &p);
    j = prime(p);
    if (j == 1) count++;
  }
  printf("%d", count);
  return 0;
}
