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