#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << setprecision(32);
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  int z = (min(x, y) / 2) * 2;
  x -= z;
  y -= z;
  int ans = x * a + y * b + z * 2 * c;
  ans = min(ans, x * a + y * b + z * (a + b));
  ans = min(ans, 2 * c * max(x + z, y + z));
  cout << ans << endl;
  return 0;
}
