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