#include <bits/stdc++.h>
using namespace std;
struct edge {
  int to, cost;
};
const int INF = 100000000;
int main() {
  int a, b, c, x, y, ans = 0;
  cin >> a >> b >> c >> x >> y;
  if (x % 2 != 0) {
    x--;
    ans += a;
  }
  if (y % 2 != 0) {
    y--;
    ans += b;
  }
  {} {} {} {}
  if (a * x + b * y > c * 2 * max(x, y)) {
    cout << ans + c * 2 * max(x, y) << endl;
  } else {
    cout << ans + a * x + b * y << endl;
  }
  return 0;
}
