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