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