program test 
implicit none

integer(8) :: i,j,k,l,m,n,a,b,ans,ans2

read(*,*) n

ans2 = 0

do m = 1,n

if(mod(m,2) == 1) then

ans = 0

do i = 1,m
if(mod(m,i) == 0) then
ans = ans + 1
endif
enddo

if(ans == 8) then
ans2 = ans2 + 1
endif

endif

enddo

write(*,*) ans2

end program