#include <bits/stdc++.h>
int main() {
  int n, cnt, i, j, num, sosuu = 0;
  while (1) {
    scanf("%d", &n);
    if (n >= 1 && n <= 10000) break;
  }
  for (i = 0; i < n; i++) {
    while (1) {
      scanf("%d", &num);
      if (num >= 2 && num <= 100000000) break;
    }
    cnt = 0;
    for (j = 1; j < num; j++)
      if (num % j == 0) cnt++;
    if (cnt == 1) sosuu++;
  }
  printf("%d\n", sosuu);
  return 0;
}
