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