#include <bits/stdc++.h>
int main() {
  int n, a[10000], i, j, r, k = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < n; i++) {
    for (j = 2; j < a[i]; j++) {
      r = a[i] % j;
      if (r == 0) break;
    }
    if (r != 0) k++;
  }
  printf("%d\n", k);
  return 0;
}
