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