#include <iostream> 
#include <cstdio> 
#include <fstream> 
#include <algorithm> 
#include <cmath> 
#include <deque> 
#include <vector> 
#include <queue> 
#include <string> 
#include <cstring> 
#include <map> 
#include <stack> 
#include <set> 
using namespace std;
int main(){
int a,b,c,x,y,d;
long long ans=10000000000000001;
cin>>a>>b>>c>>x>>y;
 for(int i=0;i<=min(x,y)*2;i+=2)
  if(ans>=(i*c+(x-i/2)*a+(y-i/2)*b))
    ans=(i*c+(x-i/2)*a+(y-i/2)*b);
 for(int i=min(x,y)*2;i<=max(x,y)*2;i+=2)
  if(ans>=(i*c+(max(x,y)-i/2)*b))
    ans=(i*c+(max(x,y)-i/2)*b);
if(x==0)
ans=min(y*b,c*y);
if(y==0)
ans=min(x*a,x*c);  
cout<<ans;
system("pause");
return 0;
}
}