#include <bits/stdc++.h>
#pragma warning(disable : 4996)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
int nearestEven(int to) { return (to % 2 == 0) ? to : (to - 1); }
struct A {
  void solve(std::istream& cin, std::ostream& cout) {
    long long A, B, c, X, Y;
    cin >> A >> B >> c >> X >> Y;
    bool pref = false;
    if (2ll * c > A + B) pref = true;
    long long res1 = 0;
    long long res2 = 0;
    if (!pref) {
      long long buy_c = min(nearestEven(X), nearestEven(Y));
      long long buy_A = X - buy_c, buy_B = Y - buy_c;
      res1 += (buy_A * A + buy_B * B) + ((2 * buy_c) * c);
    } else {
      res1 += ((X * A + Y * B));
    }
    res2 = (max(X, Y) * 2 * c);
    cout << min(res1, res2) << "\n";
  }
};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  A solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
