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