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