#include <bits/stdc++.h>
int main(int argc, char** argv) {
  int n, v;
  int i, found;
  int cnt;
  scanf("%d", &n);
  cnt = 0;
  while (n-- > 0) {
    scanf("%d", &v);
    if (v < 2) {
      continue;
    }
    found = 0;
    for (i = 2; i < v; i++) {
      if (v % i == 0) {
        found = 1;
        break;
      }
    }
    if (!found) {
      cnt++;
    }
  }
  printf("%d\n", cnt);
  return 0;
}
