#include <bits/stdc++.h>
using namespace std;
int f(int x) {
  if (x == 2) return 1;
  if (x % 2 == 0) return 0;
  for (int i = 3; i <= x / 2; i += 2) {
    if (x % i == 0) return 0;
  }
  return 1;
}
int main(void) {
  int a;
  scanf("%d", &a);
  int A[a];
  int count = 0;
  for (int i = 0; i < a; i++) {
    scanf("%d", &A[i]);
    count += f(A[i]);
  }
  printf("%d\n", count);
  return 0;
}
