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