#include <bits/stdc++.h>
int main() {
  int a, b, c, x, y;
  std::cin >> a >> b >> c >> x >> y;
  long long res = 100000000;
  for (int k = 0; k <= std::min(x, y); k++) {
    long long m = a * (x - k) + b * (y - k) + c * 2 * k;
    if (m < res) {
      res = m;
    }
  }
  std::cout << res << std::endl;
  return 0;
}
