divisors n = divisors' n 1

divisors' n d
    | d * d > n = []
    | n `mod` d == 0 = if d == d' then d:ds else d:d':ds
    | otherwise = divisors' n (d + 1)
    where d' = n `div` d
          ds = divisors' n (d + 1)

main = do
    n <- readLn :: IO Int
    print $ length $ filter (\a -> odd a && length (divisors a) == 8) [1..n]