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