import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

res = 0
li = []
li2 = []
for i in range(5):
    li.append(int(input()))
for num in li:
    if num % 10 == 0:
        li2.append(100)
    else:
        li2.append(num % 10)
for j in range(5):
    if min(li2) == li2[j] or li[j] % 10 == 0:
        res += li[j]
    else:
        res += (li[j] // 10 + 1) * 10
print(res)