l = [int(input()) for _ in range(5)]

a = list(map(lambda x: x % 10, l))
for i in range(len(a)):
    if a[i] == 0:
        a[i] = 10
a
mini = min(a)
index = a.index(mini)
def calc(x):
    if x % 10 == 0:
        return x
    else:
        return 10 + (x // 10) * 10
ans = 0
for i in range(len(l)):
    if i == index:
        print(l[i])
        ans += l[i]
    else:
        add = calc(l[i])
        print(add)
        ans += add
print(ans)