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