#include <bits/stdc++.h>
using namespace std;
int MAX(int a, int b) {
  if (a < b) {
    return b;
  } else {
    return a;
  }
}
int main() {
  int A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  int min = A * X + B * Y;
  for (int a = X; a >= 0; a--) {
    for (int b = Y; b >= 0; b--) {
      int c = MAX(X - a, Y - b);
      int sum = A * a + B * b + 2 * C * c;
      if (sum < min) {
        min = sum;
      }
    }
  }
  cout << min << endl;
}
