#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000007;
const long long int INF = 99999999999999999;
long long int A, B, C, X, Y;
string str, resstr;
int main() {
  cout << fixed << setprecision(18);
  cin >> A >> B >> C >> X >> Y;
  if (2 * C <= A && 2 * C <= B) {
    cout << 2 * C * max(X, Y) << endl;
    return 0;
  }
  if (2 * C >= A + B) {
    cout << A * X + B * Y << endl;
    return 0;
  }
  if (2 * C < A + B && (2 * C > A || 2 * C > B)) {
    if (X >= Y)
      cout << 2 * C * Y + A * (X - Y) << endl;
    else {
      cout << 2 * C * X + A * (Y - X) << endl;
    }
  }
}
