module Main where main :: IO () main = do { h <- getInt ; q <- getInt ; u <- getInt ; let (d,m) = divMod u 25 (d',m') = divMod ((q+d)*25) 100 (d'',m'') = divMod ((h+d')*100) 1000 ; print (m+m'+m'') } getInt :: IO Int getInt = read <$> getLine