#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;


void eating_symbols_easy()
{
  string s;
  cin >> s;

  int cnt = 0;
  for (int i = 0; i < 4; ++i)
  {
    if (s[i] == '+') ++cnt;
    else --cnt;
  }
  cout << cnt << "\n";
}


void multiple_of_2_and_n()
{
  int n;
  cin >> n;

  if (n % 2 == 0) cout << n << "\n";
  else cout << 2 * n << "\n";
}


void task_scheduling_problem()
{
  vector<int> a(3);
  for (int i = 0; i < 3; ++i) cin >> a[i];

  sort(a.begin(), a.end());

  cout << a[2] - a[0] << "\n";
}


void rated_for_me()
{
  int r;
  cin >> r;

  if (r < 1200) cout << "ABC\n";
  else if (r < 2800) cout << "ARC\n";
  else cout << "AGC\n";
}


void atcoder_crackers()
{
  int n, k;
  cin >> n >> k;

  if (n % k == 0) cout << 0 << "\n";
  else cout << 1 << "\n";
}


void garden()
{
  int a, b;
  cin >> a >> b;

  cout << (a - 1) * (b - 1) << "\n";
}


void train()
{
  int n, i;
  cin >> n >> i;

  cout << n - i + 1 << "\n";
}


void Pair()
{
  int k;
  cin >> k;

  if (k % 2 == 0) cout << k / 2 * k / 2 << "\n";
  else cout << k / 2 * (k / 2 + 1) << "\n";
}


void ABC333()
{
  int a, b;
  cin >> a >> b;

  if ((a == 1 && (b == 1 || b == 3)) || (a == 3 && (b == 1 || b == 3))) cout << "Yes\n";
  else cout << "No\n";
}


void maximize_the_formula()
{
  int a, b, c;
  cin >> a >> b >> c;

  int v_max = max({ a,b,c });
  cout << a + b + c + 9 * v_max << "\n";
}


void digit_sums()
{
  int n;
  cin >> n;

  int s = 0, tmp = n;
  while (tmp > 0)
  {
    s += tmp % 10;
    tmp /= 10;
  }
  if (n % s == 0) cout << "Yes\n";
  else cout << "No\n";
}


void maximum_difference()
{
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];

  sort(a.begin(), a.end());

  cout << a[n - 1] - a[0] << "\n";
}

void string_rotation() 
{
  string s, t;
  cin >> s >> t;

  for (int i = 0; i < s.size(); ++i)
  {
    if (s == t)
    {
      cout << "Yes\n";
      return;
    }
    char c = s.back();
    s.pop_back();
    s = c + s;
  }
  cout << "No\n";
}


void accepted()
{
  string s;
  cin >> s;

  if (s[0] != 'A')
  {
    cout << "WA\n";
    return;
  }

  int cnt = 0;
  for (int i = 1; i < s.size(); ++i)
  {
    if (i >= 2 && i <= s.size() - 2 && s[i] == 'C') ++cnt;
    else if (s[i] < 97)
    {
      cout << "WA\n";
      return;
    }
  }

  if (cnt != 1)
  {
    cout << "WA\n";
    return;
  }

  cout << "AC\n";
}


void cakes_and_donuts()
{
  int n;
  cin >> n;

  int flag = 0;
  for (int i = 0; i <= n / 4; ++i)
  {
    for (int j = 0; j <= n / 7; ++j)
    {
      if (i * 4 + j * 7 == n) flag = 1;
    }
  }
  if (flag) cout << "Yes\n";
  else cout << "No\n";
}


void B_106()
{
  int n;
  cin >> n;

  int ans = 0;
  for (int i = 1; i <= n; i+=2)
  {
    int cnt = 0;
    for (int j = 1; j <= i; ++j)
    {
      if (i % j == 0) ++cnt;
    }
    if (cnt == 8) ++ans;
  }
  cout << ans << "\n";
}


int main()
{
  //eating_symbols_easy();
  //multiple_of_2_and_n();
  //task_scheduling_problem();
  //rated_for_me();
  //atcoder_crackers();
  //garden();
  //train();
  //Pair();
  //ABC333();
  //maximize_the_formula();

  //digit_sums();
  //maximum_difference();
  //string_rotation();
  //accepted();
  //cakes_and_donuts();
  B_106();
}

Measured memory_bytes: 256