A, B, C, X, Y = map(int, input().split())

ans = A*X + B*Y

i = 1
while True:
    if X-i < 0 or Y-i < 0:
        break
    cost = A*(X-i) + B*(Y-i) + 2*C*i
    if cost > ans:
        break
    ans = min(cost, ans)
    i += 1

print(ans)
