n*2*c;
        if(x>y){
            long long sn=x-y;
            ans1+=min(sn*a,sn*2*c);
        }
        else{
            long long sn=y-x;
            ans1+=min(sn*b,sn*2*c);
        }
    }
    ans2+=x*a+y*b;
    if(ans1!=0)
    cout << min(ans1,ans2) << endl;
    else
    cout << ans2 << endl;
    return 0;
}
