import math

X = [int(eval(input())) for _ in range(5)]

t = 0

m = 100

for x in X:

  t += (math.ceil(x/10))*10

  if x%10 != 0:

    m = min(m, x%10)

print((t+m-10 if m!=100 else t))
from itertools import permutations

import math

X = [int(eval(input())) for _ in range(5)]

Time = lambda X: sum(math.ceil(X[i]/10)*10 for i in range(4))+X[-1]

print((min(Time(x) for x in permutations(X))))
import math

X = [int(eval(input())) for _ in range(5)]
t = 0
m = 100
for x in X:
    t += (math.ceil(x / 10)) * 10
    if x % 10 != 0:
        m = min(m, x % 10)
print((t + m - 10 if m != 100 else t))

from itertools import permutations
import math

X = [int(eval(input())) for _ in range(5)]
Time = lambda X: sum(math.ceil(X[i] / 10) * 10 for i in range(4)) + X[-1]
print((min(Time(x) for x in permutations(X))))

+from itertools import permutations -t = 0 -m = 100 -for x in X: -    t += (math.ceil(x / 10)) * 10 -    if x % 10 != 0: -        m = min(m, x % 10) -print((t + m - 10 if m != 100 else t)) +Time = lambda X: sum(math.ceil(X[i] / 10) * 10 for i in range(4)) + X[-1] +print((min(Time(x) for x in permutations(X))))