#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;
  if (A + B <= 2 * C)
    cout << A * X + B * Y << endl;
  else {
    int ans = 1000000000;
    for (int i = 0; i <= 300000; i++) {
      int tmp = C * 2 * i + A * max(0, X - i) + B * max(0, Y - i);
      ans = min(tmp, ans);
    }
    cout << ans << endl;
    return 0;
  }
}
