#include <bits/stdc++.h>
int main() {
  int l, s, j, i;
  int count1 = 0, count2 = 0;
  scanf("%d", &l);
  for (i = 0; i < l; i++) {
    j = 1;
    count1 = 0;
    scanf("%d", &s);
    while (s > j) {
      if (s % j == 0) count1++;
      j++;
    }
    if (count1 == 1) {
      count2++;
    }
  }
  printf("%d\n", count2);
}
