#include <bits/stdc++.h>
using namespace std;
int main() {
  long long h, w, i, j, halfkosu;
  double a, b, c, x, y, halfvalue, ans2 = 0, ans = 0;
  bool flg;
  cin >> a >> b >> c >> x >> y;
  halfvalue = min((a + b) / 2, c);
  halfkosu = min(x, y);
  ans = halfkosu * halfvalue * 2 + a * (x - halfkosu) + b * (y - halfkosu);
  ans2 = halfvalue * 2 * max(x, y);
  ans = min(ans, ans2);
  std::cout << ans << std::endl;
  return 0;
}
