#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  long long a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  long long res = a * x + b * y;
  long long cand = res;
  for (int i = 0; i < (max(x, y) + abs(x - y)); ++i) {
    if (i < min(x, y)) {
      cand -= a + b;
      cand += c * 2;
    } else {
      cand -= (min(x, y) == x) ? a : b;
      cand += c * 2;
    }
    res = min(res, cand);
  }
  cout << res << endl;
}
