#include <bits/stdc++.h>
using namespace std;
int main() {
  long long A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  long long m = 1 << 120;
  for (int i = 0; i <= X; i++) {
    if (i * A > m) {
      break;
    }
    for (int j = 0; j <= Y; j++) {
      long long k = max((X - i) * 2, (Y - j) * 2);
      long long cost = i * A + j * B + k * C;
      if (cost > m) {
        break;
      }
      m = cost;
    }
  }
  cout << m << endl;
}
