import sys
input = sys.stdin.readline
num = []
iti = []

for temp in range(5):
    temp2 = input()
    temp3 = int(temp2)
    if temp3 >= 10 and temp2[-2] != "0":
        num.append((int(temp2[0:-2])+1)*10)
    elif temp2[-2] == "0":
        num.append(int(temp2[0:-2])*10)
    else:
        num.append(10)
    if int(temp2[-2]) != 0:
        iti.append(int(temp2[-2]))

if iti == []:
    last = 0
else:
    last = min(iti)
print(sum(num)-10+last)