#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);
    if (t == 2)
      counter++;
    else {
      for (j = 3; j < t; j += 2) {
        if (t % j == 0) break;
      }
      if (j == t) counter++;
    }
  }
  printf("%d\n", counter);
  return 0;
}
