program contest
  implicit none

  integer :: n, i, j, p, q

  read(*,*) n
  
  q = 0

  do j = 1, n, 2
     p = 0
     do i = 1, j
        if(mod(j,i)==0) then
           p = p + 1
        end if
     end do
     if(p == 8) then
        q = q + 1
!        write(*,*) j
     end if
  end do

  write(*,*) q
  stop
end program contest
