a, b, c, x, y =map(int, input().split())
ab = 2*c
i = 1
cost = 0
while True:
    cost = i *ab
    if i <= x  or i <= y:
        break
    i += 1
cost += a *(max(0, (x-i)))
cost += b *(max(0, (y-i)))
print(cost)