a, b, c, x, y = map(int, input().split())
ans = []

for n in range(0, max(x, y) * 2, 2):
    p = n * c * 2
    nx = max(0, x - n)
    ny = max(0, y - n)
    p += nx * a + ny * b
    ans.append(p)

print(min(ans))