#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;
  if (x == 2)
    return 0;
  else if (x % 2 == 0)
    return 1;
  for (j = 3; j < sqrt(x); j += 2) {
    if (x % j == 0) {
      num = 1;
      break;
    }
  }
  return num;
}
