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