#include <bits/stdc++.h>
int main() {
  int n, A[10001], i;
  scanf("%d", &n);
  for (i = 0; i <= n - 1; i++) {
    scanf("%d\n", &A[i]);
  }
  int k = 0, l, m = 0;
  for (i = 0; i <= n - 1; i++) {
    for (l = 2; l < A[i]; l++) {
      if (A[i] % l == 0) {
        k = 1;
        break;
      }
    }
    if (k == 0) m++;
  }
  printf("%d\n", m - 1);
}
