#include <bits/stdc++.h>
int main(void) {
  int n, m, s, i, count, k = 0;
  scanf("%d", &n);
  for (m = 1; m <= n; m++) {
    scanf("%d", &s);
    count = 0;
    for (i = 1; i <= s; i++) {
      if (s % i == 0) count++;
    }
    if (count == 2) k++;
  }
  printf("%d", k);
  return 0;
}
