#include <bits/stdc++.h>
using namespace std;
const int MAX_VALUE = 1e8;
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  int ans = MAX_VALUE;
  int cur_a = x;
  int cur_b = y;
  int cur_c = 0;
  while (cur_a >= 0 && cur_b >= 0) {
    ans = min(ans, cur_a * a + cur_b * b + cur_c * c);
    cur_a--;
    cur_b--;
    cur_c += 2;
  }
  cout << ans << endl;
  return 0;
}
