A,B,C,X,Y = map(int,input().split())
mini=float("inf")

for a in range(0,X+1):
  for b in range(0,Y+1):
    c_num = max( 2*(X-a), 2*(Y-b) )
    P= A*a + B*b + C*c_num
    mini=min(mini,P)
    
print(mini)