vegie_price = float(input())
fruit_price = float(input())
vegie_amount = float(input())
fruit_amount = float(input())
euro = 1.94

print((vegie_amount * vegie_price + fruit_amount * fruit_price)/euro)

vegie_price = float(input())
fruit_price = float(input())
vegie_amount = float(input())
fruit_amount = float(input())
euro = 1.94

print((vegie_amount * vegie_price + fruit_amount * fruit_price)/euro)
