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