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