print(sum([max(40,eval(input())) for i in [1]*5])/5)
print(sum([max(8,eval(input())/5) for i in [1]*5]))
print(sum([max(40, eval(input())) for i in [1] * 5]) / 5)

print(sum([max(8, eval(input()) / 5) for i in [1] * 5]))

-print(sum([max(40, eval(input())) for i in [1] * 5]) / 5) +print(sum([max(8, eval(input()) / 5) for i in [1] * 5]))