#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <map>
#include <string>
#include <cmath>
#include <algorithm>
#include <functional>
#include <utility>
using ll = long long int;
using namespace std;
double pi = 3.141592653589793238;

#define FOR(i,N) for(int i=0;i<N;i++)
#define pb(x) push_back(x)

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

	ll ans = 0;
	if (A > 2 * C) {
		if (B > 2 * C) {
			ans = max(X, Y) * 2 * C;
		}
		else {
			ans = 2 * C * X + B * max(Y - 2 * X, 0);
		}
	}
	else {
		if (B > 2 * C) {
			ans = 2 * C * Y + A * max(X - 2 * Y, 0);
		}
		else {
			if (A + B > 2 * C) {
				if (X > Y) {
					ans = 2 * Y * C + A * (X - Y);
				}
				else {
					ans = 2 * X * C + B * (Y - X);
				}
				
			}
			else {
				ans = X * A + Y * B;
			}
		}
	}
	cout << ans;
}