#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stdio.h>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <math.h>
#include <iomanip>
using namespace std;
#define Would
#define you
const int INF = 9999999;
const int MOD = 1e9 + 7;

int main() {
	long long a, b, c, d, e, ans=INF;
	cin >> a >> b >> c >> d >> e;
	for (int i = 0; i < 100001; ++i) {
		ans = min(ans, c * 2 * i + max(d - i, 0)*a + max(e - i, 0)*b);
	}
	cout << ans << endl;
}
