x = [int(input()) for i in range(5)]
y = [0,0,0,0,0]
for i in range(5):
    if x[i] % 10 ==0:
        y[i] = 9
    else:
        y[i] = x[i] % 10 

m = y.index(min(y))
import math
ans = 0
for i in range(5):
    if i != m:
        ans = ans + 10*math.ceil(x[i]/10)
        print(ans)
    else:
        ans = ans + x[i]

print(ans)