#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  int ans = INT_MAX;
  ans = min(ans, A * X + B * Y);
  int res = INT_MAX;
  for (int i = 0; i < max(X, Y); i++) {
    int sum = ans;
    int c = i + 1;
    if (c > A) A = 0;
    if (c > B) B = 0;
    sum -= (A * c + B * c);
    sum += 2 * c * C;
    res = min(res, sum);
  }
  cout << res << endl;
}
