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