ss = [int(input()) for i in range(5)]
import itertools
mm = list(itertools.permutations(ss))
ans = 0
anss = 10**9
for sc in mm:
    ans = 0
    for i in range(len(sc)):
        if i == 4:
            ans += sc[i]
        else:
            ans += round(sc[i],-1)
    anss = min(anss , ans)
print(anss)