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