#include <bits/stdc++.h>
int main() {
  int n;
  int in;
  int num_prime = 0;
  bool isPrime = true;
  scanf("%d", &n);
  if (n < 1 || n > 10000) {
    printf("Error: n is out of range");
    return -1;
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &in);
    if (in < 2 || in > 10e8) {
      printf("Error: value[i] is out of range");
      return -1;
    }
    if (in == 2 || in == 3) {
      isPrime = true;
    } else if (in % 2 != 0) {
      for (int i = 3; i < in; i += 2) {
        if (in % i == 0) {
          isPrime = false;
          break;
        }
      }
    }
    if (isPrime == false) {
      continue;
    } else if (isPrime == true) {
      num_prime += 1;
    }
  }
  printf("%d\n", num_prime);
}
