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