#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  int ans = C * 2 * max(X, Y);
  int i = 0;
  while (i < 2 * max(X, Y)) {
    int sum = C * i + A * (X - i / 2) + B * (Y - i / 2);
    ans = min(ans, sum);
    i += 2;
  }
  cout << ans << endl;
  return 0;
}
