#include <bits/stdc++.h>
int main() {
  unsigned long n, count = 0, a[10000], i, j, temp = 0;
  scanf("%ld", &n);
  for (i = 0; i < n; i++) {
    scanf("%ld", &a[i]);
    if (a[i] == 2)
      count++;
    else {
      temp = 0;
      for (j = 2; j <= sqrt(a[i]); j++) {
        if (a[i] % j == 0) temp++;
      }
      if (temp == 2) count++;
    }
  }
  printf("%ld\n", count);
  return 0;
}
