number_list = [input() for _ in range(5)]
last_digit = [int(n[-1]) if int(n[-1]) != 0 else 1000 for n in number_list]
min_last_digit_index = last_digit.index(min(last_digit))
print(sum([int(n) if i == min_last_digit_index else round(int(n), -1)
           for i, n in enumerate(number_list)]))