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

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

print(mini)