(let ((ans 0)
      (mx 10)
      temp)
     (dotimes (i 5)
       (setf temp (read))
       (incf ans (* 10 (ceiling temp 10)))
       (if (not (zerop (rem temp 10))) (setf mx (min mx (rem temp 10))))
     (if (not (= 10 mx)) (decf ans 10) (setf mx 0))
     (princ (+ mx ans)))