#include <bits/stdc++.h>
int main(void) {
  int n, x;
  int counter = 0;
  int is_prime = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    if (x == 2) {
      counter++;
      continue;
    }
    if (!(x % 2) || x == 1) continue;
    is_prime = 1;
    for (int j = 2; j < x; j++) {
      if (x % j == 0) {
        is_prime = 0;
        break;
      }
    }
    if (is_prime) counter++;
  }
  printf("%d\n", counter);
  return 0;
}
