#include <bits/stdc++.h>
using namespace std;
const int minum = 104;
const int MAX = 200;
int main() {
  long long ans = 0;
  long long N;
  cin >> N;
  if (N <= minum)
    ;
  else if (N == 105)
    ans = 1;
  else {
    for (long long i = 107; i <= N; i += 2) {
      long long div = 0;
      for (long long j = 1; j <= i; j += 2) {
        if (i % j == 0) div++;
      }
      if (div == 8) ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
