#include<iostream>

typedef long long ll;
using namespace std;

int main()
{ll A,B,C,X,Y; cin >> A >> B >> C >> X >> Y;

 ll min_sum = 1e9;
 for(ll m = 0; m <= min(X,Y); m++)
 { ll sum = (X-m)*A + (Y-m)*B + 2*m*C;
  min_sum = min(min_sum, sum);}
 
 cout << max_sum << endl;
 
 return 0;
}