#include <bits/stdc++.h>
int main() {
  int i, j, l, c, count;
  long a;
  count = 0;
  scanf("%d", &l);
  for (i = 0; i < l; i++) {
    scanf("%ld", &a);
    c = 0;
    if (a == 1) continue;
    for (j = 1; j <= a; j++) {
      if ((a % j) == 0) c++;
    }
    if (c == 2) count++;
  }
  printf("%d\n", count);
  return 0;
}
