import qualified Data.ByteString.Char8 as BC import Data.Maybe(fromJust) main :: IO() main = BC.getContents >>= print.(\[x, y, z] -> solve x y z).map (fst.fromJust.BC.readInt).BC.lines solve :: Int -> Int -> Int -> Int solve x y z | x >= 10 = solve (x - 10) y z | y >= 4 = solve (x + 1) (y - 4) z | z >= 25 = solve x (y + 1) (z - 25) | otherwise = x + y + z