#include <bits/stdc++.h>
int main() {
  int A[10000];
  int prime = 0, fl, i, j, num;
  for (i = 0; i < 10000; i++) {
    if (scanf("%d", &A[i]) == EOF) break;
    num++;
  }
  for (i = 0; i < num; i++) {
    for (j = 2; j < (A[i] / 2) + 1; j++) {
      if (A[i] == 2 || A[i] == 3) {
        prime++;
        break;
      } else if (A[i] % j == 0) {
        fl = 1;
        break;
      }
    }
    if (fl == 0) {
      prime++;
    }
    fl = 0;
  }
  printf("%d\n", prime);
  return 0;
}
