#include <cstdio>

int main() {
  int N;
  scanf("%d", &N);

  int res=0;
  for (int i=3; i<=N; i+=2) {
    int divs=0;
    for (int j=1; j<=i; ++j)
      if (i % j == 0) ++divs;

    if (divs == 8) ++res;
  }
  printf("%d\n", res);
}
