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