#include<bits/stdc++.h> using namespace std; int main(){ double a,b,c; double aa,bb,cc; cin>>a>>b>>c>>aa>>bb>>cc; printf("VALOR A PAGAR: R$ %.2lf",b*c+bb*cc); }