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]
ans = arr.sum * 100
arr.permutation(5) do |pArr|
	for i in 0..3 do
		pArr[i] = (pArr[i] / 10.0).ceil * 10
	end
	ans = [ans, pArr.sum].min
end
p ans.to_i