A = gets.to_f
B = gets.to_f
C = gets.to_f
D = gets.to_f
E = gets.to_f
arr = [A, B, C, D, E]
min = arr.sum * 100
arr.permutation(5) do |pArr|
	for i in 0..3 do
		pArr[i] = (pArr[i] / 10.0).ceil * 10
	end
	min = [min, pArr.sum].min
end
p min.to_i