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