a = [int(input()) for i in range(5)]
b =[]
c = []
ch = False
t = 0
for i in a:
    if ch == False and i % 10 != 0 and i % 10 <= 5:
        t += i
        print(i)
        ch = True
    elif i % 10 == 0:
        t += i
    else:
        t += (int(i/10) + 1)*10
print(t)