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