let () =
  let ts = Array.init 5 @@ fun _ -> Scanf.scanf " %d" Fun.id in
  let sum = Array.fold_left (fun acc elt -> acc + (elt + 9) / 10 * 10) 0 ts in
  let ans = ( - ) sum @@ Array.fold_left (fun acc elt -> max acc @@ ((elt + 9) / 10 * 10) - elt) 0 ts in
  Printf.printf "%d\n" ans

  