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