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

z = min(x, y)
if (a + b) // 2 > c:
    ans += z * c * 2
    x, y = x - z, y - z

for i, j in ((a, x), (b, y)):
    if a // 2 > c:
        ans += j * c * 2
    else:
        ans += i * j

print(ans)