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