#include <iostream>

int main() {
  uint32_t N = 0;
  std::cin >> N;
  const uint32_t ans[] = {105, 135, 165, 189, 195};
  uint32_t i = 0;
  for (; i < 5 && N >= ans[i]; i++) continue;
  std::cout << i << std::endl;

  return 0;
}