#include <bits/stdc++.h>
int main() {
  int n[10000], count = 0, status, f, i, j;
  for (i = 0; i < 10000; i++) {
    status = scanf("%d", &n[i]);
    for (j = 2; j <= n[i] - 1; j++) {
      if (n[i] % j == 0) f = 1;
    }
    if (f == 0) count++;
    f = 0;
  }
  printf("%d\n", count);
  return 0;
}
