import itertools

import math

import fractions

import functools

import copy



a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

d = int(eval(input()))

e = int(eval(input()))

original = [a,b,c,d,e]



sum = 0

minimum = 10

index = 0

for i in range(len(original)):

    if original[i] % 10 != 0:

        sum += original[i]//10 * 10 + 10

        if original[i]%10 < minimum:

            index = i

            minimum = original[i]%10

    else:

        sum += original[i]

if minimum != 10:

    print((sum-(original[index]//10 * 10 + 10)+original[index]))

else: print((a+b+c+d+e))
def main():

    # s = int(input())

    # n, k = map(int, input().split())

    # h = list(map(int, input().split()))

    # s = input()



    a = int(eval(input()))

    b = int(eval(input()))

    c = int(eval(input()))

    d = int(eval(input()))

    e = int(eval(input()))



    total = 0

    li = [a, b, c, d, e]

    mini = 10**10

    ans_idx = 0

    for i, s in enumerate(li):

        last_s = int(str(s)[-1])

        if mini > last_s and last_s != 0:

            mini = last_s

            ans_idx = i



    for i, s in enumerate(li):

        if i != ans_idx:

            if s % 10 != 0:

                total += s // 10 * 10 + 10

            else:

                total += s

        else:

            total += s



    print(total)





if __name__ == '__main__':

    main()

import itertools
import math
import fractions
import functools
import copy

a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
d = int(eval(input()))
e = int(eval(input()))
original = [a, b, c, d, e]
sum = 0
minimum = 10
index = 0
for i in range(len(original)):
    if original[i] % 10 != 0:
        sum += original[i] // 10 * 10 + 10
        if original[i] % 10 < minimum:
            index = i
            minimum = original[i] % 10
    else:
        sum += original[i]
if minimum != 10:
    print((sum - (original[index] // 10 * 10 + 10) + original[index]))
else:
    print((a + b + c + d + e))

def main():
    # s = int(input())
    # n, k = map(int, input().split())
    # h = list(map(int, input().split()))
    # s = input()
    a = int(eval(input()))
    b = int(eval(input()))
    c = int(eval(input()))
    d = int(eval(input()))
    e = int(eval(input()))
    total = 0
    li = [a, b, c, d, e]
    mini = 10**10
    ans_idx = 0
    for i, s in enumerate(li):
        last_s = int(str(s)[-1])
        if mini > last_s and last_s != 0:
            mini = last_s
            ans_idx = i
    for i, s in enumerate(li):
        if i != ans_idx:
            if s % 10 != 0:
                total += s // 10 * 10 + 10
            else:
                total += s
        else:
            total += s
    print(total)


if __name__ == "__main__":
    main()

-import itertools -import math -import fractions -import functools -import copy +def main(): +    # s = int(input()) +    # n, k = map(int, input().split()) +    # h = list(map(int, input().split())) +    # s = input() +    a = int(eval(input())) +    b = int(eval(input())) +    c = int(eval(input())) +    d = int(eval(input())) +    e = int(eval(input())) +    total = 0 +    li = [a, b, c, d, e] +    mini = 10**10 +    ans_idx = 0 +    for i, s in enumerate(li): +        last_s = int(str(s)[-1]) +        if mini > last_s and last_s != 0: +            mini = last_s +            ans_idx = i +    for i, s in enumerate(li): +        if i != ans_idx: +            if s % 10 != 0: +                total += s // 10 * 10 + 10 +            else: +                total += s +        else: +            total += s +    print(total) -a = int(eval(input())) -b = int(eval(input())) -c = int(eval(input())) -d = int(eval(input())) -e = int(eval(input())) -original = [a, b, c, d, e] -sum = 0 -minimum = 10 -index = 0 -for i in range(len(original)): -    if original[i] % 10 != 0: -        sum += original[i] // 10 * 10 + 10 -        if original[i] % 10 < minimum: -            index = i -            minimum = original[i] % 10 -    else: -        sum += original[i] -if minimum != 10: -    print((sum - (original[index] // 10 * 10 + 10) + original[index])) -else: -    print((a + b + c + d + e)) + +if __name__ == "__main__": +    main()