import math
a,b,c,d,e=(i for i in input())

last=int(min(a[-1],b[-1],c[-1],d[-1],e[-1]))
a,b,c,d,e=map(int,a,b,c,d,e)
ans=list(map(lambda x:(math.ceil(x/10))*10, a,b,c,d,e if != last)
print(sum(ans)+last)