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