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