from itertools import*
*a,=map(int,open(0).read().split())
b=[i%10for i in a]
c=a.pop(b.index(min(b)))
ans=0
#print(a)
for i in a:
    #print((i//10*10+(i%10>0)*10))
    ans+=(i//10*10+(i%10>0)*10)
print(ans+c)