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