#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 ((double)A / (double)C >= 2 && (double)B / (double)C >= 2) {
    cout << C * 2 * max(X, Y);
  } else {
    while (true) {
      if (X == 0 || Y == 0)
        break;
      else {
        X--;
        Y--;
        Z += 2;
      }
    }
    cout << A * X + B * Y + C * Z << endl;
  }
  return 0;
}
