import Data.Bits main :: IO () main = readLn >>= print . solve 1 1 0 solve :: Int -> Int -> Int -> Int -> Int solve x y acc l | 8 * (x + y) * (x + x + y) <= l = solve (x + x + y) x (acc + ((x `xor` y) .&. 1) ) l | otherwise = acc