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