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