main = do l <- readLn m <- readLn n <- readLn print $ compute l m n compute l m n = l'+m'+n' where (nc,n') = divMod n 25 (mc,m') = divMod (m+nc) 4 l' = mod (l+mc) 10