import sys

from fractions import gcd

from itertools import groupby as gb

from itertools import permutations as perm

from itertools import combinations as comb

from collections import Counter as C

from collections import defaultdict as dd

sys.setrecursionlimit(10**5)

def y(f):

    if f:

        print('Yes')

    else:

        print('No')

def Y(f):

    if f:

        print('YES')

    else:

        print('NO')

def Z(f):

    if f:

        print('Yay!')

    else:

        print(':(')

def ispow(n):

    if int(n**.5)**2==n:

        return True

    return False



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



res = 10 ** 100

for p in perm(list(range(5))):

    cur = 0

    for i in p:

        cur = (cur + 9) // 10 * 10

        cur += l[i]

    res = min(res, cur)

print(res)

from itertools import permutations as perm



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

res = 10 ** 100

for p in perm(l):

    tmp = 0

    for i in p:

        tmp = (tmp + 9) // 10 * 10

        tmp += i

    res = min(res, tmp)

print(res)
import sys
from fractions import gcd
from itertools import groupby as gb
from itertools import permutations as perm
from itertools import combinations as comb
from collections import Counter as C
from collections import defaultdict as dd

sys.setrecursionlimit(10**5)


def y(f):
    if f:
        print("Yes")
    else:
        print("No")


def Y(f):
    if f:
        print("YES")
    else:
        print("NO")


def Z(f):
    if f:
        print("Yay!")
    else:
        print(":(")


def ispow(n):
    if int(n**0.5) ** 2 == n:
        return True
    return False


l = [int(eval(input())) for _ in range(5)]
res = 10**100
for p in perm(list(range(5))):
    cur = 0
    for i in p:
        cur = (cur + 9) // 10 * 10
        cur += l[i]
    res = min(res, cur)
print(res)

from itertools import permutations as perm

l = [int(eval(input())) for _ in range(5)]
res = 10**100
for p in perm(l):
    tmp = 0
    for i in p:
        tmp = (tmp + 9) // 10 * 10
        tmp += i
    res = min(res, tmp)
print(res)

-import sys -from fractions import gcd -from itertools import groupby as gb -from itertools import combinations as comb -from collections import Counter as C -from collections import defaultdict as dd - -sys.setrecursionlimit(10**5) - - -def y(f): -    if f: -        print("Yes") -    else: -        print("No") - - -def Y(f): -    if f: -        print("YES") -    else: -        print("NO") - - -def Z(f): -    if f: -        print("Yay!") -    else: -        print(":(") - - -def ispow(n): -    if int(n**0.5) ** 2 == n: -        return True -    return False - -for p in perm(list(range(5))): -    cur = 0 +for p in perm(l): +    tmp = 0 -        cur = (cur + 9) // 10 * 10 -        cur += l[i] -    res = min(res, cur) +        tmp = (tmp + 9) // 10 * 10 +        tmp += i +    res = min(res, tmp)