# coding: utf-8

import sys

import numpy as np



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



A = np.zeros(5, np.int32)

for i in range(5):

    A[i] = ir()



remain = A % 10

remain = remain[remain>0]

ceil10 = (np.ceil(A/10) * 10).astype(np.int32)

answer = ceil10.sum()

if len(remain) != 0:

    minus = 10 - remain.min()

    answer -= minus

print(answer)

# coding: utf-8

import sys



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



A = [ir() for _ in range(5)]

ceil_time = [(x+9)//10*10 for x in A]

can_save = [y - x for y, x in zip(ceil_time, A)]

answer = sum(ceil_time) - max(can_save)

print(answer)

# coding: utf-8
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
A = np.zeros(5, np.int32)
for i in range(5):
    A[i] = ir()
remain = A % 10
remain = remain[remain > 0]
ceil10 = (np.ceil(A / 10) * 10).astype(np.int32)
answer = ceil10.sum()
if len(remain) != 0:
    minus = 10 - remain.min()
    answer -= minus
print(answer)

# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
A = [ir() for _ in range(5)]
ceil_time = [(x + 9) // 10 * 10 for x in A]
can_save = [y - x for y, x in zip(ceil_time, A)]
answer = sum(ceil_time) - max(can_save)
print(answer)

-import numpy as np -A = np.zeros(5, np.int32) -for i in range(5): -    A[i] = ir() -remain = A % 10 -remain = remain[remain > 0] -ceil10 = (np.ceil(A / 10) * 10).astype(np.int32) -answer = ceil10.sum() -if len(remain) != 0: -    minus = 10 - remain.min() -    answer -= minus +A = [ir() for _ in range(5)] +ceil_time = [(x + 9) // 10 * 10 for x in A] +can_save = [y - x for y, x in zip(ceil_time, A)] +answer = sum(ceil_time) - max(can_save)