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



ans = max(x,y)*2*c

s = max(x,y)



while s:

    tmp = 0

    tmp -= c*2

    s -= 1

    if x > s:

        tmp += a

    if y > s:

        tmp += b

    if tmp > 0:

        print(ans)

        exit()

    else:

        ans += tmp

        

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

 

if a+b <= c * 2:

    print((x*a + y*b))

    exit()

    

ans = 0

 

ans += min(x,y) * c * 2

 

if x >= y:

    ans += min((x-y)*a, (x-y)*2*c)

else:

    ans += min((y-x)*b, (y-x)*2*c)

    

print(ans)
a, b, c, x, y = list(map(int, input().split()))
ans = max(x, y) * 2 * c
s = max(x, y)
while s:
    tmp = 0
    tmp -= c * 2
    s -= 1
    if x > s:
        tmp += a
    if y > s:
        tmp += b
    if tmp > 0:
        print(ans)
        exit()
    else:
        ans += tmp
print(ans)

a, b, c, x, y = list(map(int, input().split()))
if a + b <= c * 2:
    print((x * a + y * b))
    exit()
ans = 0
ans += min(x, y) * c * 2
if x >= y:
    ans += min((x - y) * a, (x - y) * 2 * c)
else:
    ans += min((y - x) * b, (y - x) * 2 * c)
print(ans)

-ans = max(x, y) * 2 * c -s = max(x, y) -while s: -    tmp = 0 -    tmp -= c * 2 -    s -= 1 -    if x > s: -        tmp += a -    if y > s: -        tmp += b -    if tmp > 0: -        print(ans) -        exit() -    else: -        ans += tmp +if a + b <= c * 2: +    print((x * a + y * b)) +    exit() +ans = 0 +ans += min(x, y) * c * 2 +if x >= y: +    ans += min((x - y) * a, (x - y) * 2 * c) +else: +    ans += min((y - x) * b, (y - x) * 2 * c)