a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

import math
p = [a, b, c, d, e]
pa = [a%10, b%10, c%10, d%10, e%10]
ans = math.ceil(a/10)*10 + math.ceil(b/10)*10 + math.ceil(c/10)*10 + math.ceil(d/10)*10 + math.ceil(e/10)*10 - (10 - pa[pa.index(min([i for i in pa if i != 0]))])
print(ans)