a,b,c,x,y=map(int,input().split())
if (a+b)<=2*c:
  print(a*x+b*y)
else:
  val=2*c*(min(x,y)//2)+(2*c if min(x,y)%2==1 else 0)
  X=x-2*(min(x,y)//2)-(1 if min(x,y)%2==1 else 0)
  Y=y-2*(min(x,y)//2)-(1 if min(x,y)%2==1 else 0)
  print(val+X*a+Y*b)
    
  
  
