#include <bits/stdc++.h>
using namespace std;
int main() {
  int A, B, C;
  int X, Y;
  cin >> A >> B >> C >> X >> Y;
  double diva = A / 2;
  double divb = B / 2;
  double divab = (A + B) / 2;
  int minxy = min(X, Y);
  double sum = 0;
  if (C <= divab) {
    double subsumC = C * minxy * 2;
    if (C <= diva && C <= divb) {
      sum = C * max(X, Y) * 2;
    } else {
      if (minxy == X) {
        int Yplus = Y - minxy;
        int subsumY = B * Yplus;
        sum = subsumC + subsumY;
      } else {
        int Xplus = X - minxy;
        int subsumX = A * Xplus;
        sum = subsumC + subsumX;
      }
    }
  } else {
    sum = A * X + B * Y;
  }
  cout << sum << endl;
}
