#include <bits/stdc++.h>
using namespace std;
int main() {
  int A = 0, B = 0, C = 0, X = 0, Y = 0, Z = 0;
  cin >> A >> B >> C >> X >> Y;
  if (A + B <= 2 * C) {
    cout << A * X + B * Y << endl;
  } else {
    if (A >= 2 * C && B < 2 * C) {
      cout << X * 2 * C + B * (Y - 2 * C) << endl;
    } else if (B >= 2 * C && A < 2 * C) {
      cout << Y * 2 * C + A * (X - 2 * C) << endl;
    } else if (A >= 2 * C && B >= 2 * C) {
      cout << 2 * C * max(X, Y) << endl;
    } else {
      cout << 2 * C * min(X, Y) + A * (X - min(X, Y)) + B * (Y - min(X, Y))
           << endl;
    }
  }
  return 0;
}
