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