#include <bits/stdc++.h>
int main(void) {
  int n, m = 1, s, i, count = 0;
  scanf("%d", &n);
  while (m <= n) {
    scanf("%d", &s);
    if (s == 2) count++;
    for (i = 2; i <= s - 1; i++) {
      if (s % i == 0) break;
      if (i == s - 1) count++;
    }
    m++;
  }
  printf("%d", count);
  return 0;
}
