#include <bits/stdc++.h>
int check_prime(int target) {
  int is_prime = 1;
  for (int i = 2; i <= target / 2; i++) {
    if (target % i == 0) {
      is_prime = 0;
      break;
    }
  }
  return is_prime;
}
int main() {
  int N;
  scanf("%d", &N);
  int A[N];
  for (int i = 0; i < N; i++) {
    scanf("%d", &A[i]);
  }
  int cnt = 0;
  int target;
  for (int i = 0; i < N; i++) {
    target = A[i];
    if (check_prime(target)) {
      cnt++;
    }
  }
  printf("%d\n", cnt);
  return 0;
}
