#include<stdio.h>
int main(){
 int a,b,c,needa,needb,money=0,minneed;
 scanf("%d %d %d %d %d",&a,&b,&c,&needa,&needb);
 if(2*c<(a+b)){
       minneed=(needa>needb)?(needb:needa);
       needa-=minneed;
      needb-=minneed;
      money+=minneed*c
        
  }
if(needa>0){
           if(2*c<a){
                  money+=2*c*needa;
              }
            else{
               money+=a*needa;
             }
needa=0;
  }
if(needb>0){
           if(2*c<b){
                  money+=2*c*needb;
              }
            else{
               money+=b*needb;
             }
  }
printf("%d",money);
 return 0;
}
