#include <bits/stdc++.h>
int main(void) {
  int n, i, j, sum = 0, no;
  scanf("%d", &n);
  long A[n];
  for (i = 0; i < n; i++) {
    scanf("%ld", &A[i]);
    if (A[i] == 2)
      sum++;
    else if (A[i] % 2 != 0) {
      no = 1;
      for (j = 3; j < sqrt(A[i]); j += 2) {
        if (A[i] % j == 0) {
          no = 0;
          break;
        }
      }
      if (no) sum++;
    }
  }
  printf("%d\n", sum);
  return 0;
}
