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