a1,a2,a3 = map(float,input().split()) b1,b2,b3 = map(float,input().split()) result = (a2*a3)+(b2*b3) print("VALOR A PAGAR: R$ %.2f"%(result))