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