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