#include <bits/stdc++.h>
int PM(int b) {
  int flag = 0;
  if (b == 2) {
    flag = 1;
    return flag;
  } else if (b % 2 == 0)
    return flag;
  double sqrtb = sqrt(b);
  for (int j = 3; j <= sqrtb; j += 2) {
    if (b % j == 0) return flag;
  }
  flag = 1;
  return flag;
}
int main(void) {
  int a = 0, n, m, i, cnt = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &m);
    a = PM(m);
    cnt = cnt + a;
  }
  printf("%d", cnt);
}
