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