abc = gets.to_i
arc = gets.to_i
agc = gets.to_i
apc = gets.to_i
atc = gets.to_i

abc_a = (abc*0.1).ceil*10
arc_a = (arc*0.1).ceil*10
agc_a = (agc*0.1).ceil*10
apc_a = (apc*0.1).ceil*10
atc_a = (atc*0.1).ceil*10

abc_b = abc_a - abc
arc_b = arc_a - arc
agc_b = agc_a - agc
apc_b = apc_a - apc
atc_b = atc_a - atc

array = [abc_b,arc_b,agc_b,apc_b,atc_b]

b = 0
array.each do |n|
  b = n if n >= b
end


puts abc_a + arc_a + agc_a + apc_a + atc_a - b
