#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  long long res = 1000000000;
  if (c * 2 > a + b) {
    res = a * x + b * y;
  } else if (a > c * 2 || b > c * 2) {
    res = min(c * 2 * x + b * max(y - x, 0), c * 2 * y + a * max(x - y, 0));
  } else {
    for (int pizza_a = 0; pizza_a < x; ++pizza_a) {
      long long temp_cost = pizza_a * a;
      int temp_a = x - pizza_a;
      int temp_b = y;
      for (int pizza_b = 0; pizza_b < y; ++pizza_b) {
        temp_cost += pizza_b * b;
        temp_b -= pizza_b;
        int pizza_ab = max(temp_a, temp_b) * 2;
        temp_cost += pizza_ab * c;
        if (temp_cost < res) {
          res = temp_cost;
        }
      }
    }
  }
  cout << res << endl;
  return 0;
}
