main :: IO ()
main = do
    n <- readLn
    let pat = map patterns [1..n]
    let dub = zip pat [1..]
    let res = map validate dub
    sequence_ $ map print res
        where
            patterns n = let up = floor $ sqrt n in [(x,y,z) | x <- [1..up], y <- [1..up], z <- [1..up]]
            validate (pats, n) = count $ filter (validate_ n) pats
            validate_ n (x, y, z) = ((x + y + z) ^ 2) - x * y - y * z - z * x == n
            count [] = 0
            count (x:xs) = 1 + count xs