#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
template <typename T>
inline T digit(T num) {
  T sum = 0;
  while (num) {
    sum += num % 10;
    num /= 10;
  }
  return sum;
}
template <typename T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <typename T>
inline T lcm(T a, T b) {
  T g = gcd(a, b);
  return a / g * b;
}
template <typename T>
inline T power(T a, T b) {
  T tmp = 1;
  for (int i = 0; i < ((int)(b)); ++i) {
    tmp *= a;
  }
  return tmp;
}
bool isOk(int key, int value) { return value >= key; }
int binary_search(vector<int> a, int key) {
  int ok = a.size();
  int ng = -1;
  while (abs(ok - ng) > 1) {
    int mid = (ok + ng) / 2;
    if (isOk(key, a[mid]))
      ok = mid;
    else
      ng = mid;
  }
  return ok;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  int a, b, ab, x, y;
  cin >> a >> b >> ab >> x >> y;
  long long ans = 0;
  if (a >= ab * 2 && b >= ab * 2) {
    ans = max(x, y) * ab * 2;
    cout << ans << endl;
    return 0;
  }
  if (a + b >= ab * 2) {
    int tmp = min(x, y);
    x -= tmp;
    y -= tmp;
    ans += tmp * (x + y) * ab * 2;
  }
  ans += x * a;
  ans += y * b;
  cout << ans << endl;
  return 0;
}
