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