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)
  X=x-2*(min(x,y)//2)
  Y=y-2*(min(x,y)//2)
  print(min(val+2*c,val+c+(X-1)*a+(Y-1)*b,val+X*a+Y*b))
    
  
  