#include <bits/stdc++.h>
int main(void) {
  int n, count = 0, countn = 0;
  long long p;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &p);
    for (int j = 2; j * j <= p; j++) {
      if (p % j == 0) {
        count = 0;
      } else {
        count = 1;
      }
    }
    countn += count;
  }
  printf("%d\n", countn);
  return 0;
}
