#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, x, y;
  long long int ans = 0;
  cin >> a >> b >> c >> x >> y;
  if (a + b < 2 * c) {
    cout << a * x + b * y << endl;
    return 0;
  } else {
    int tmp = min(x, y);
    x -= tmp;
    y -= tmp;
    ans += c * tmp * 2;
    if (x > 0 && a > 2 * c) ans += x * c * 2;
    if (y > 0 && b > 2 * c) ans += y * c * 2;
    cout << ans << endl;
  }
  return 0;
}
