(defn abc123-B
  [xs]
  (let [X (->> xs
            (map #(int (Math/ceil (/ % 10))))
            (map (partial * 10)))
        Y (->> xs
            (map #(rem % 10))
            (map #(cond (= 0 %) 0
                        :else (- 10 %))))]
    (- (reduce + X) (apply max Y))))
(defn main-abc123-B []
  (let [xs (doall (for [_ (range 5)] (read)))]
    (println (abc123-B xs))))
(main-abc123-B)
