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