#include <bits/stdc++.h>
int main() {
  int i, num;
  int sosu = 0;
  int count = 0;
  while (scanf("%d", &num) != EOF) {
    for (i = 2; i < num; i++) {
      if (num % i == 0) {
        sosu = 1;
        break;
      }
    }
    if (sosu != 0) count++;
  }
  printf("%d", count);
  return 0;
}
