#include <bits/stdc++.h>
int main() {
  int i, j;
  int a;
  double k;
  int count = 0;
  int y;
  scanf("%d", &a);
  for (i = 0; i < a; i++) {
    y = 0;
    if (a == 2)
      count++;
    else if (a == 1)
      count += 0;
    else {
      for (j = 3; i < a; j += 2) {
        k = sqrt(a);
        if (j > k) break;
        if (a % j == 0) {
          y = 1;
          break;
        }
      }
      if (y == 0) count++;
    }
  }
  printf("%d\n", count);
  return 0;
}
