A,B,C,X,Y = map(int,input().split())
ans = 100000000000000000000000000000000000000
for c in range (max(2*X,2**Y)):
  price = A*max(0,X-(0.5*c))+B*max(0,Y-(0.5*c))+C*c
  if price < ans:
    ans = price
print(int(ans))