a = []
for i in range(6):
    a.append(int(input()))
    
result = 0
for each in a:
    if each % 10 != 0:
        result += each + 10 - (each % 10)
    else:
        result += each
print(result)
    