#include <bits/stdc++.h>
using namespace std;
int main() {
  int A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  long m = 1000000000, sum;
  for (int i = 0; i <= X; i++)
    for (int j = 0; j <= Y; j++) {
      sum = i * A + j * B + max(X - i, Y - j) * 2 * C;
      m = min(sum, m);
    }
  cout << m;
}
