#include <bits/stdc++.h>
using namespace std;
constexpr int MOD = 1000000007;
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
void print(const std::vector<int> &v) {
  std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
  std::cout << std::endl;
}
int main() {
  int A, B, C;
  long long X, Y;
  cin >> A >> B >> C >> X >> Y;
  if (A + B <= 2 * C) {
    cout << X * A + Y * B << endl;
    return 0;
  } else {
    long long m = min(X, Y);
    long long res = 0;
    res += 2 * m * C;
    res += A * (X - m);
    res += B * (Y - m);
    cout << res << endl;
    return 0;
  }
}
