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