dishes = [int(input()) for i in range(5)]

ans = 0
min_digits = 10
digits_idx = 0
for idx, dish in enumerate(dishes):
  ans += round(dish, -1)
  if dish%10 < mindigits:
    digits_idx = idx
  	min_digits = dish%10
ans = ans + dishes[digits_idx] - round(dishes[digits_idx], -1)
print(ans)