#include <bits/stdc++.h>
int check(int n) {
  int i;
  for (i = 2; i < n; i++) {
    if (n % i == 0) return 0;
  }
  return 1;
}
int main() {
  int n, i;
  int *a;
  int prime = 0;
  scanf("%d", &n);
  a = (int *)malloc(sizeof(int) * n);
  for (i = 0; i < n; i++) {
    scanf("%d", a + i);
    prime += check(*(a + i));
  }
  printf("%d\n", prime);
  return 0;
}
