#include <bits/stdc++.h>
int main() {
  int x;
  scanf("%d", &x);
  int s, cnt = 0;
  for (int i = 0; i < x; i++) {
    scanf("%d", &s);
    if (s == 2 || s == 3 || s == 5 || s == 7) {
      cnt += 1;
    } else if (!(1 < s && s <= 10) && s % 2 != 0) {
      for (int w = 3; w <= s / 2; w++) {
        if (s % w == 0) {
          break;
        } else if (w == s / 2) {
          cnt += 1;
          break;
        }
      }
    }
  }
  printf("%d\n", cnt);
  return 0;
}
