#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using Graph = vector<vector<int> >;
const ll M = 1000000007;
int main() {
  ll a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  int v = 2 * max(x, y);
  ll sum = c * v;
  ll tmp = sum;
  while (tmp <= sum && v >= 0) {
    sum = tmp;
    tmp = sum + a + b - c * 2;
    v -= 2;
  }
  tmp = a * x + b * y;
  int va = x, vb = y;
  while (tmp <= sum && va >= 0 && vb >= 0) {
    sum = tmp;
    tmp = sum - a - b + 2 * c;
    va--, vb--;
  }
  cout << sum << endl;
}
