a, b, c, x, y = [int(i) for i in input().split(" ")]

s = [x, y, 0]
charge = s[0]*a+s[1]*b+s[2]*c
for i in range(min(x, y), 0, -1):
  s = [s[0]-1, s[1]-1, s[2]+2]
  charge = min(charge, s[0]*a+s[1]*b+s[2]*c)
print(charge)