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