#include <bits/stdc++.h>
int main() {
  int N, cnt;
  int prime;
  cnt = 0;
  scanf(" %d", &N);
  for (int i = 0; i < N; i++) {
    scanf(" %d", &prime);
    if (prime == 2 || prime == 3) {
      cnt++;
    } else if (prime % 2 != 0) {
      ;
      for (int j = 2; j < sqrt(prime); j++) {
        if (prime % j != 0) {
          cnt++;
        }
      }
    }
  }
  printf("%d\n", cnt);
  return 0;
}
