g n k = if n<k then 0 else (if mod n k ==0 then 1 else 0) + g n (k+1)
f x n = if n>x then 0 else (if g n 1 == 8 then 1 else 0) + f x (n+2)
main=do
 x<-readLn
 (print.(\x->if x<105 then 0 else f x 105))x