#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
const long long INF = 1000LL * 1000 * 1000 * 1000 * 1000 * 1000;
const int inf = 1000 * 1000 * 1000;
const long double PI = acos(-1.0);
const long long mod1 = inf + 7;
const long long mod2 = inf + 9;
const int MAXN = 500001;
const long double EPS = 1e-9;
int hp = 179;
signed main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  int ans = inf;
  for (int ab = 0; ab <= 2 * max(x, y); ab += 2) {
    int tans = ab * c + max(x - ab * 2, 0) * a + max(y - ab * 2, 0) * b;
    ans = min(ans, tans);
  }
  cout << ans;
}
