#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  int Min = 2000000000;
  for (int(i) = 0; (i) < (max(x, y) * 2); (i)++) {
    int j = i + 1;
    int ca = max(0, x - j / 2), cb = max(0, y - j / 2);
    int cost = ca * a + cb * b + j * c;
    Min = min(Min, cost);
  }
  cout << Min << endl;
}
