import math
a=[input() for i in range(5)]
b,c=10,0
for i in range(5):
    if 0<int(a[i][-1])<b:
        b=int(a[i][-1])
        d=i
for i in range(5):
    if i==d:
        c+=int(a[i])
    else:
        if int(a[i][-1])==0:
            c+=int(a[i])
        elif int(a[i])<=10:
            c+=10
        else:
            c+=(int(a[i][0:-1])+1)*10
print(c)