program ABC106B
    implicit none
    integer(8)::i,j
    integer(8)::N,sqrt_N,divisor
    integer(8)::result=0
    
    read(5,*)N

    do i=1,N
        if(mod(i,2)==1)then
            divisor=0
            sqrt_N=int(sqrt(real(i)))
            do j=1,sqrt_N
                if(mod(i,j)==0)then
                    divisor=divisor+1
                    if(j/=i/j)then
                        divisor=divisor+1
                    end if
                end if
            end do
            
            if(divisor==8)then
                result=result+1
            end if
        end if
    end do

    print'(i0)',result
end program ABC106B