#include <bits/stdc++.h>
int main() {
  int sosu[10001];
  int i, j, yak, n, count = 0;
  int *a;
  for (i = 1; i < 10001; i++) {
    yak = 0;
    for (j = 1; j <= i; j++) {
      if (i % j == 0) yak++;
    }
    if (yak == 2)
      sosu[i] = 1;
    else
      sosu[i] = 0;
  }
  scanf("%d", &n);
  a = (int *)malloc(sizeof(int) * n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  for (i = 0; i < n; i++) {
    if (sosu[a[i]] == 1) count++;
  }
  printf("%d\n", count);
  free(a);
  return 0;
}
