#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 <=x; ++i){
     for (int j=0; j<=y; ++j){
      ll k=max(x-i,y-j);
      ll ans =a*i+b*j+c*k
     sum=min(sum,ans);
     }
} 
      
  cout << sum <<endl;

}
