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