#include <bits/stdc++.h>
int ifprime(int n);
int main() {
  int n;
  int readScan = scanf("%d", &n);
  int a[n];
  int count;
  count = 0;
  for (int i = 0; i < n; i++) {
    int readScan = scanf("%d", &a[i]);
    if (a[i] == 2 || a[i] == 3) count++;
    int prime;
    if (a[i] > 3) {
      if (ifprime(a[i]) == 1) count++;
    }
  }
  printf("%d \n", count);
  return (EXIT_SUCCESS);
}
int ifprime(int n) {
  int i;
  for (i = 2; i <= n / 2; i++) {
    if (n % i == 0) return 0;
  }
  return 1;
}
