t = [int(input()) for i in range(5)]
minimum = 10
k = 10
t2 = list()
ans = 0

for i in range(5):
    #    print(-(-t[i] // 10) * 10)
    t2.append(-(-t[i] // 10) * 10)
    if 0 < t[i] % 10 < minimum:
        minimum = t[i] % 10
        k = i

#print(minimum, k)

for i in range(5):
    print(t2[i])
    if i == k:
        ans += t[i]
    else:
        ans += t2[i]


print(ans)