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