#include <bits/stdc++.h>
int main() {
  int n;
  int i, count1 = 0, count2 = 0;
  while (scanf("%d", &n) != EOF) {
    count1++;
    if (n != 2 && n % 2 == 0) count2++;
    if (n == 8) count2++;
    for (i = 3; i <= sqrt(n); i += 2) {
      if (n % i == 0) count2++;
    }
  }
  printf("%d\n", count1 - count2);
  return 0;
}
