#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const long long MOD = 1e9 + 7;
const long long int INF = 1LL << 60;
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  int ans = INT_MAX;
  for (int i = 0; i < (int)1e5; i++) {
    ans = min(ans, 2 * c * i + a * max(x - i, 0) + b * max(y - i, 0));
  }
  cout << ans << endl;
}
