#include <bits/stdc++.h>
char sosuu(double);
int main() {
  int a, n, sum = 0;
  char judge;
  int x[10000];
  scanf("%d", &n);
  for (a = 0; a < n; a++) {
    scanf("%d", &x[a]);
  }
  for (a = 0; a < n; a++) {
    judge = sosuu(x[a]);
    if (judge == 'T') sum++;
  }
  printf("%d\n", sum);
  return 0;
}
char sosuu(double x) {
  int m;
  double n;
  n = sqrt(x);
  for (m = 2; m <= n; m += 2) {
    if ((int)x % m == 0) {
      return 'F';
      break;
    }
  }
  return 'T';
}
