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

dishes = sorted(dishes, key=lambda x: 10 - int(str(x)[-1]))
# a = list()
# b = list()
# for d in dishes:
#     if d % 10 == 0:
#         a.append(d)
#     else:
#         b.append(d)
# b = [d + 10 - d % 10 for d in b[:-1]] + [b[-1]]
# dishes = a + b
# print(sum(dishes))
#
print(1)
