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