#python3

INF = int(1e9)

def main():

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

    ans = INF

    for i in range(2*10**5+100):

        t = 2*c*i + max(x-i, 0) * a + max(y-i, 0) * b

        ans = min(ans, t)

    print(ans)

main()
INF = int(1e5)+5



def main():

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

    ans = INF*INF

    for i in range(INF):

        tmp = 2*i*c + a*max(x-i, 0) + b*max(y-i, 0) 

        ans = min(tmp, ans)

    print(ans)

main()

# python3
INF = int(1e9)


def main():
    a, b, c, x, y = list(map(int, input().split()))
    ans = INF
    for i in range(2 * 10**5 + 100):
        t = 2 * c * i + max(x - i, 0) * a + max(y - i, 0) * b
        ans = min(ans, t)
    print(ans)


main()

INF = int(1e5) + 5


def main():
    a, b, c, x, y = list(map(int, input().split()))
    ans = INF * INF
    for i in range(INF):
        tmp = 2 * i * c + a * max(x - i, 0) + b * max(y - i, 0)
        ans = min(tmp, ans)
    print(ans)


main()

-# python3 -INF = int(1e9) +INF = int(1e5) + 5 -    ans = INF -    for i in range(2 * 10**5 + 100): -        t = 2 * c * i + max(x - i, 0) * a + max(y - i, 0) * b -        ans = min(ans, t) +    ans = INF * INF +    for i in range(INF): +        tmp = 2 * i * c + a * max(x - i, 0) + b * max(y - i, 0) +        ans = min(tmp, ans)