#include <bits/stdc++.h>
using namespace std;
const long long INF = (1LL << 60);
long long a, b, c;
int x, y;
int main() {
  cin >> a >> b >> c >> x >> y;
  long long res = INF;
  int n = max(x, y);
  for (int i = 0; i <= n * 4; i += 2) {
    long long cnt_a = 0;
    long long cnt_b = 0;
    long long cnt_c = 0;
    if (x - i >= 0) cnt_a = x - i;
    if (y - i >= 0) cnt_b = y - i;
    cnt_c = i * 2;
    res = min(res, a * cnt_a + b * cnt_b + c * cnt_c);
  }
  cout << res << endl;
}
