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