# ABC95 C -Half and Half

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

ans = 0

if a+b > 2*c:

    while x != 0.0 and y != 0.0:

        ans += 2*c

        x -= 1.0

        y -= 1.0

        if y == 0.0:

            while x != 0.0:

                if a > 2*c:

                    ans += 2*c

                    x -= 1.0

                else:

                    ans += a

                    x -= 1.0

        if x == 0.0:

            while y != 0.0:

                if b > 2*c:

                    ans += 2*c

                    y -= 1.0

                else:

                    ans += b

                    y -= 1.0

else:

    ans += a*x + b*y

print((int(ans)))



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

ans=0

ans1=0



e=max(x,y)

ans1=e*(2*c)

if 2*c<a+b:

    d=min(x,y)

    ans+=c*(2*d)

    x-=d

    y-=d

else:

    ans=a*x+b*y

    x-=x

    y-=y

ans+=x*a

ans+=y*b

print((min(ans,ans1)))
# ABC95 C -Half and Half
a, b, c, x, y = list(map(float, input().split()))
ans = 0
if a + b > 2 * c:
    while x != 0.0 and y != 0.0:
        ans += 2 * c
        x -= 1.0
        y -= 1.0
        if y == 0.0:
            while x != 0.0:
                if a > 2 * c:
                    ans += 2 * c
                    x -= 1.0
                else:
                    ans += a
                    x -= 1.0
        if x == 0.0:
            while y != 0.0:
                if b > 2 * c:
                    ans += 2 * c
                    y -= 1.0
                else:
                    ans += b
                    y -= 1.0
else:
    ans += a * x + b * y
print((int(ans)))

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

-# ABC95 C -Half and Half -a, b, c, x, y = list(map(float, input().split())) +a, b, c, x, y = list(map(int, input().split())) -if a + b > 2 * c: -    while x != 0.0 and y != 0.0: -        ans += 2 * c -        x -= 1.0 -        y -= 1.0 -        if y == 0.0: -            while x != 0.0: -                if a > 2 * c: -                    ans += 2 * c -                    x -= 1.0 -                else: -                    ans += a -                    x -= 1.0 -        if x == 0.0: -            while y != 0.0: -                if b > 2 * c: -                    ans += 2 * c -                    y -= 1.0 -                else: -                    ans += b -                    y -= 1.0 +ans1 = 0 +e = max(x, y) +ans1 = e * (2 * c) +if 2 * c < a + b: +    d = min(x, y) +    ans += c * (2 * d) +    x -= d +    y -= d -    ans += a * x + b * y -print((int(ans))) +    ans = a * x + b * y +    x -= x +    y -= y +ans += x * a +ans += y * b +print((min(ans, ans1)))