#include <bits/stdc++.h>
int main() {
  int i, j = 1, k, c = 0, sum = 0, N;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &k);
    while (j != k) {
      j = 1;
      if (k % j == 0) c++;
      j++;
    }
    if (c == 2) sum++;
    c = 0;
  }
  printf("%d\n", sum);
  return 0;
}
