(defparameter abcde
  (loop repeat 5
        collect (read)))

(defun f (abcde)
  (+ (* 10 (1- (loop for i in abcde
                     sum (ceiling i 10))))
     (reduce #'min
             (remove 0 (mapcar (lambda (i) (mod i 10))
                               abcde)))))

(princ (f abcde))