A = gets.to_f
B = gets.to_f
C = gets.to_f
D = gets.to_f
E = gets.to_f

AC = (A/10).ceil() * 10
BC = (B/10).ceil() * 10
CC = (C/10).ceil() * 10
DC = (D/10).ceil() * 10
EC = (E/10).ceil() * 10

diff = [AC-A, BC-B, CC-C, DC-D, EC-E].max
puts (AC + BC + CC + DC + EC - diff).to_i
