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

temp = 10
for i in range(5):
    if li[i]%10 != 0 and li[i]%10 < temp:
        temp = li[i]%10
        s = i
else:
    t = li.pop(s)
    
ans = 0

for i in li:
    if i%10 == 0:
        ans += i//10
    else:
        ans += 1 + i//10
        
print(ans * 10 + t)