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