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