#include <bits/stdc++.h>
using namespace std;

int main() {
  
  long long a,b,c,x,y;
  cin >> a >> b >> c >> x >> y;
  
  long long price = a * x + b * y,Tprice;
  
  for ( int i = 1; i <= 100000; i++){
    Tprice = i * 2 * c + max(0,x-i) * a + max(0,y-i) * b;
    price = min(price,Tprice);
  }
  
  cout << price << endl;
  
}