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