total = 0
for i in range(3):
    haiten, wariai = map(int, input().split())
    tokuten = haiten * wariai / 10
    total += tokuten
print(int(total))

973847f2c3c36dd9a8f13d5c5f3657b37098ed8e
<mask token>

<mask token>
for i in range(3):
    haiten, wariai = map(int, input().split())
    tokuten = haiten * wariai / 10
    total += tokuten
print(int(total))

total = 0
for i in range(3):
    haiten, wariai = map(int, input().split())
    tokuten = haiten * wariai / 10
    total += tokuten
print(int(total))
