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