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