#include <bits/stdc++.h>
using namespace std;
using ll = long long;
string char_to_string(char val) { return string(1, val); }
int main() {
  int A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  if (A > C) {
    cout << C * max({X, Y}) * 2 << endl;
  } else if ((A + B) / 2 > C) {
    int min_num = min({X, Y});
    cout << C * min_num * 2 + (X - min_num) * A + (Y - min_num) * B << endl;
  } else {
    cout << A * X + B * Y << endl;
  }
}
