#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
    ll a,b,c,x,y;
  cin >>a>>b>>c>>x>>y;
  ll sum=1000000000;
  
for (int i = 0; i <=max(x,y); ++i){
      ll j=max(x-i,0);
      ll k=max(y-i,0)
      ll ans =a*j+b*k+2*c*i;
     sum=min(sum,ans);
     }
    
  cout << sum <<endl;

}
