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