#include <bits/stdc++.h>
using namespace std;
long long minAr(vector<long long> v) {
  long long min = 300000000000000000;
  for (long long i = 0; i < v.size(); i++) {
    if (min > v[i]) {
      min = v[i];
    }
  }
  return min;
}
long long A, B, C, X, Y, delta, c, pay;
int main() {
  cin >> A >> B >> C >> X >> Y;
  long long pays = 0;
  vector<long long> payAr;
  long long x, y, c;
  if (2 * C < A + B) {
    if (X < Y) {
      c = 2 * X;
    } else {
      c = 2 * Y;
    }
  } else {
    c = 0;
  }
  pay += A * (X - c / 2) + B * (Y - c / 2) + C * c;
  cout << pay << endl;
  return 0;
}
