main=readLn>>=print.f
 where f n = (if (g n n)==8 then 1 else 0)+(if n==1 then 0 else (f (n-1)))
       g n i |odd n     = (if (mod n i)==0 then 1 else 0)+(if i==1 then 0 else (g n (i-1)))
             |otherwise = 0