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