#include <bits/stdc++.h>
int prime(int x) {
  int c, i;
  if ((x != 2) || (x % 2 == 0)) {
    return 0;
  } else if (x == 2) {
    return 1;
  }
  if (x < 2) {
    return 0;
  }
  for (i = 3; i * i <= x; i += 2) {
    if (x % i == 0) {
      return 0;
    }
  }
  return 1;
}
int main() {
  int a, m, count = 0, n;
  scanf("%d", &n);
  for (a = 1; a <= n; a++) {
    m = 0;
    scanf("%d", &m);
    if (prime(m) == 1) count += 1;
  }
  printf("%d\n", count);
  return 0;
}
