#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(x)(x).begin(), (x).end() // 昇順ソート
#define rall(v)(v).rbegin(), (v).rend() // 降順ソート
#define INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair < ll, ll >
#define F first
#define S second
const int MOD = 1000000007;
template < class T > bool chmax(T & a,const T & b) { if (a < b) { a = b; return true; } return false; }
template < class T > bool chmin(T & a,const T & b) { if (a > b) { a = b; return true; } return false; }
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

int main() {
    LL A,B,C,X,Y;cin >> A >> B >> C >> X >> Y;
    LL sum = 0;

    LL t = min(X,Y);
    LL s = max(X,Y);

    LL tmp1 = s * C * 2;
    LL tmp2 = A * X + B * Y;
    LL tmp3 = t * C * 2;
    if(X > Y){
        tmp3 += (X-Y)*A;
    }
    else{
        tmp3 += (Y-X)*B;
    }

    LL ans = max(tmp1,tmp2);
    ans = max(ans,tmp3);

    int tmp4 = X*2*C + (Y-X)*B;
    int tmp5 = Y*2*C + (X-Y)*A;

    ans = max(ans,tmp4);
    ans = max(ans,tmp5);
    
    cout << ans << endl;
}