#include <bits/stdc++.h>
int prime(int);
int main(void) {
  int n;
  scanf("%d", &n);
  int a, ans = 0;
  for (a = 1; a <= n; a++) {
    int num;
    scanf("%d", &num);
    if (prime(num) == 0) {
      ans++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
int prime(int b) {
  int i = 2;
  while (i <= b - 1) {
    if (b % i == 0) {
      return 1;
    } else {
      i++;
    }
  }
  return 0;
}
