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