#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, x, y, sum = 0;
  cin >> a >> b >> c >> x >> y;
  if (a + b < c * 2) {
    cout << (a * x) + (b * y) << endl;
  } else if (a > c * 2 || b > c * 2) {
    cout << c * max(x, y) * 2 << endl;
  } else {
    if (min(x, y) % 2 == 0) {
      if (x > y) {
        cout << c * min(x, y) * 2 + a * (x - y) << endl;
      } else {
        cout << c * min(x, y) * 2 + b * (y - x) << endl;
      }
    } else {
      if (x > y) {
        cout << c * (min(x, y) - 1) * 2 + b + a * (x - y + 1) << endl;
      } else {
        cout << c * (min(x, y) - 1) * 2 + a + b * (y - x + 1) << endl;
      }
    }
  }
  return 0;
}
