module Main where import Control.Applicative import Control.Monad exchange :: Int -> Int exchange amt = c + e + g where (a, b) = amt `divMod` 1000 (c, d) = b `divMod` 100 (e, f) = d `divMod` 25 (g, _) = f `divMod` 1 main :: IO () main = do [l, m, n] <- fmap read . take 3 . lines <$> getContents let amt = l * 100 + m * 25 + n * 1 print $ exchange amt