a,b,c,x,y=map(int,input().split())
d=(a+b)/2
import sys
o=x
w=y
count=0
if d>=c:
    if x>=y:
        r=x
        
        x-=y
        y=0
        count+=((r-x)*2*c)
        count+=(x*a)
        print(min(count,(o*2*c)))
        sys.exit()
      

    else:
        r=y
        
        y-=x
        x=0
        count+=((r-y)*2*c)
  
        count+=(x*a)
        
        
        print(min(count,w*2*c))
        sys.exit()
    
        
else:
    count+=a*x+b*y    
    print(count)

    
