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