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