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