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