program sample
  implicit none
  integer :: n,i,j,count8
  integer,allocatable :: count(:)

  read(*,*) n
  allocate(count(n))

  count=0
  count8=0
  count(1)=1
  do i=2,n
     do j=1,i-1
        if(mod(i,j)==0)then
           count(i)=count(i)+1
        endif
     enddo
     if(count(i)==8.and.mod(i,2)==1)then
        count8=count8+1
     endif
     
  enddo

  write(*,*) count8

  stop
  
end program sample