import Data.List (sort)

main :: IO ()
main = do
  a <- read <$> getLine :: IO Double
  b <- read <$> getLine :: IO Double
  c <- read <$> getLine :: IO Double
  d <- read <$> getLine :: IO Double
  e <- read <$> getLine :: IO Double
  let
    ts = sort . map (\i -> let c = 10 * ceiling (i / 10) in (ceiling i - c, c)) $ [a, b, c, d, e]
  print $ fst (head ts) + sum (map snd ts)
