#include <bits/stdc++.h>
int Prime(int);
int main() {
  int k[10000], n;
  int i, num = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &k[i]);
    if (Prime(k[i]) == 0) num++;
  }
  printf("%d\n", num);
  return 0;
}
int Prime(int x) {
  int j, num = 0;
  for (j = 2; j < x; j++) {
    if (x % j == 0) num++;
  }
  return num;
}
