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