#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <math.h>
#include <string>
using namespace std;
typedef long long ll;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll a , b , c , x , y;
    cin >> a >> b >> c >> x >> y;
	ll ans = 100000000;
  	for( ll i = 0 ; i <= max( x , y ) ; i++ ) {
    	ll d = max( x - i , 0 ) * a + max( y - i , 0 ) * b + i * 2 * c;
    	ans = min( ans , d );
  	}
  	cout << ans;
}
