#include <bits/stdc++.h>
int a[10000000];
int shu(int a[], int n);
int main() {
  int n, i, k;
  while (scanf("%d", &n) != EOF) {
    for (i = 0; i < n; i++) {
      scanf("%d", &a[i]);
    }
    k = shu(a, n);
    printf("%d\n", k);
  }
  return 0;
}
int shu(int a[], int n) {
  int i, j, k = 0;
  for (i = 0; i < n; i++) {
    j = 2;
    while (j < a[i]) {
      if (a[i] % j == 0) break;
      j++;
    }
    if (j == a[i]) k++;
  }
  return k;
}
