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