#include <bits/stdc++.h>
int main() {
  int n, i, j, flg;
  int *A;
  int count = 0;
  scanf("%d", &n);
  A = (int *)malloc(n * sizeof(int));
  for (i = 0; i < n; i++) {
    scanf("%d", &A[i]);
  }
  for (i = 0; i < n; i++) {
    flg = 0;
    for (j = 2; j <= sqrt(A[i]); j += 2) {
      if (A[i] % j == 0) {
        flg = 1;
        break;
      }
    }
    if (flg == 0) count++;
  }
  printf("%d\n", count);
  return 0;
}
