#include <bits/stdc++.h>
const int inf = 2e9;
using namespace std;
class SameColorPairs {
 public:
  vector<string> removePairs(vector<string> board) {
    vector<string> ret;
    int H = board.size(), W = board[0].size();
    for (int i = 0; i < H; ++i)
      for (int j = 1; j < W; ++j)
        if (board[i][j] == board[i][j - 1]) {
          ret.push_back(to_string(i) + " " + to_string(j) + " " + to_string(i) +
                        " " + to_string(j - 1));
        }
    return ret;
  }
};
template <class T>
void getVector(vector<T>& v) {
  for (int i = 0; i < v.size(); ++i) cin >> v[i];
}
int main() {
  int a, b, c, na, nb;
  scanf("%d%d%d%d%d", &a, &b, &c, &na, &nb);
  long long mi = inf;
  int ca, cb;
  int tope = max(na, nb);
  for (int i = 0; i <= tope; i += 2) {
    ca = na - i;
    cb = nb - i;
    if (na - i < 0) ca = 0;
    if (nb - i < 0) cb = 0;
    mi = min(mi, long long((i * c * 2) + ca * a + cb * b));
  }
  return !printf("%lld", mi);
}
