program main
  implicit none
  integer :: N
  integer,allocatable  :: divisor(:)
  integer :: out
  integer :: i,j 
  read (*,*) N
  allocate(divisor(N))
  divisor = 0
  do i = 1, N
     do j = 1, i
        if (mod(i,j) ==0 ) then
           divisor(i) = divisor(i)+1
        end if
     end do
  end do
  out = 0
  do i = 1, N
     if ( mod(i,2) /= 0 .and. divisor(i) == 8 ) then
        out = out + 1
     end if
  end do
  write(*,'(i0)') out 
  stop
end program main
