#include <bits/stdc++.h>
int sosudiagnosis(int);
int main() {
  int n;
  int s;
  int l = 0;
  int count = 0;
  scanf("%d", &n);
  while (l < n) {
    l++;
    scanf("%d", &s);
    if (sosudiagnosis(s) == 1) count++;
  }
  printf("%d\n", count);
}
int sosudiagnosis(int sosu) {
  int i = 3;
  if (sosu == 2) return 1;
  if (sosu < 2 || sosu % 2 == 0) return 0;
  while (i <= sqrt(sosu)) {
    if (sosu % i == 0) return 0;
    i = i + 2;
  }
  return 1;
}
