import math
 
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
 
li = [a, b, c, d, e]
 
idx = sorted(list(map(lambda x: [x, (x[1] % 10) + 10] if x[1] == 0 else x, [[0, a], [1, b], [2, c], [3, d], [4, e]])), key=lambda x: x[1])[0][0]
print(sum(map(lambda x: li[x] if x == idx else math.ceil(li[x] * 0.1) * 10, [0, 1, 2, 3, 4])))