a, b, c, x, y = map(int, input().split())
ha = c/2
cost = 10000000000000000
for i in range(x):
  for j in range(y):
    res = a*i + 2*ha*(x-i) + b*j + 2*ha*(y-j)
    if x - i != y - j:
      res += abs((x-i)-(y-j))*2*ha
    if res < cost:
      cost = res
print(int(cost))

      

