#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const long long MOD = 1000000007;
const long long INF = 1LL << 60;
int main() {
  int A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  int ans = 100000000;
  for (int i = 0; i <= max(2 * X, 2 * Y); i++) {
    int tmp = C * i + A * max(0, X - i / 2) + B * max(0, Y - i / 2);
    ans = min(tmp, ans);
  }
  cout << ans << endl;
  return 0;
}
