answer = 0
for i in range(5):
    score = int(input())
    if score > 40:
        answer += score
    else:
        answer += 40
print(int(answer / 5))

cfa257cff451d43dc4c78e72f0e66f6ee81293cb
<mask token>

<mask token>
for i in range(5):
    score = int(input())
    if score > 40:
        answer += score
    else:
        answer += 40
print(int(answer / 5))

answer = 0
for i in range(5):
    score = int(input())
    if score > 40:
        answer += score
    else:
        answer += 40
print(int(answer / 5))
