CodeEff/ECCO huggingface dataset:
# Original solution
#!/usr/bin/env python3
import sys, math, fractions, itertools


def solve(A: int, B: int, C: int, X: int, Y: int):
    mn = 1e9
    for i in range(0, 2*(max(X, Y)+1), 2):
        mn = min(mn, C*i+A*max(X-i//2, 0)+B*max(Y-i//2, 0))
    print((int(mn)))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    Y = int(next(tokens))  # type: int
    solve(A, B, C, X, Y)

if __name__ == '__main__':
    main()


# Optimized solution
#!/usr/bin/env python3
import sys


def solve(A: int, B: int, C: int, X: int, Y: int):
    c = 0
    if (A + B < 2 * C):
        c += min(X, Y) * (A + B)
    else:
        c += min(X, Y) * 2 * C
    if X > Y:
        c += (X - Y) * min(A, 2 * C)
    else:
        c += (Y - X) * min(B, 2 * C)
    print(c)
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    Y = int(next(tokens))  # type: int
    solve(A, B, C, X, Y)

if __name__ == '__main__':
    main()
# Original solution
a,b,c,x,y=list(map(int,input().split()))
k=min(x,y)
ans=0

if 2*c < a+b:
  ans+=2*c*k
  d=x-y
  if d>=0:
    ans+=min(a*d,2*c*d)
  else:
    ans+=min(b*(-d),2*c*(-d))
else:
  ans+=min(a*x,2*c*x)+min(b*y,2*c*y)
print(ans)

# Optimized solution
a,b,c,x,y=list(map(int,input().split()))
k=min(x,y)
ans=0

AB = 2*c
if 2*c < a+b:
  ans+=AB*k
  d=x-y
  if d>=0:
    ans+=min(a*d,AB*d)
  else:
    ans+=min(b*(-d),AB*(-d))
else:
  ans+=min(a*x,AB*x)+min(b*y,AB*y)
print(ans)
# Original solution
A, B, C, X, Y = list(map(int, input().split()))

ans = A * X + B * Y

for i in range(100001):
    total = 2 * C * i + A * max(0, X - i) + B * max(0, Y - i)
    ans = min(ans, total)

print(ans)


# Optimized solution
A, B, C, X, Y = list(map(int, input().split()))

ans = A * X + B * Y
for i in range(10 ** 5 + 1):
    total = 2 * C * i + A * max(0, X - i) + B * max(0, Y - i)
    ans = min(total, ans)

print(ans)
# Original solution
a,b,c,x,y = list(map(int,input().split()))
c *= 2
ans = 10 ** 16
for i in range(max(x,y) + 1):
    p = 0
    p += c * i
    p += a * (max(0,x - i))
    p += b * (max(0,y - i))
    ans = min(ans,p)
print(ans)

# Optimized solution
a,b,c,x,y = list(map(int,input().split()))
c *= 2
ans = 10 ** 16
for i in range(max(x,y)+1):
    m = 0
    m += (a*(max(0,x-i)))+(b*(max(0,y-i)))+(c*i)
    ans = min(ans,m)
print(ans)
# Original solution
a, b, c, x, y = list(map(int, input().split()))
res = a * x + b * y
for i in range(1, max(x, y) + 1):
    res = min(res, a * max(x - i, 0) + b * max(y - i, 0) + 2 * c * i)
print(res)

# Optimized solution
A, B, C, X, Y = list(map(int, input().split()))
res = A*X + B*Y
for i in range(max(X,Y)):
    if i >= X:
        res = min(res-B+2*C,res)
    elif i >= Y:
        res = min(res-A+2*C,res)
    else:
        res = min(res-A-B+2*C,res)
print(res)
# Original solution
A, B, C, X, Y = list(map(int, input().split()))

ans = 10**18
for ab in range(max(X, Y) * 2 + 10):
    a = max(0, X - ab // 2)
    b = max(0, Y - ab // 2)
    ans = min(ans, A * a + B * b + C * ab)
print(ans)


# Optimized solution
A, B, C, X, Y = list(map(int, input().split()))

ans = 10**18
for c in range(max(X, Y) * 2 + 1):
    x = max(0, X - c // 2)
    y = max(0, Y - c // 2)
    ans = min(ans, x * A + y * B + c * C)
print(ans)
# Original solution
a,b,c,x,y=list(map(int,input().split()))
ans=a*x+b*y
for HaH in range(0,2*max(x,y)+1,2):
    ans = min(ans, c*HaH+max(0, a*(x-HaH//2))+max(0, b*(y-HaH//2)))
print(ans)

# Optimized solution
a,b,c,x,y=list(map(int,input().split()))
ans=0
m=min(x,y)
if a+b>=2*c: #Half and Half購入で安くなる可能性あるパターン
    # HaHをm枚買って残りHaH購入,または全部HaH購入,このいずれかしかあり得ない
    ans = min(2*c*m+a*(x-m)+b*(y-m), 2*c*max(x,y))
else:
    ans = a*x+b*y
print(ans)
# Original solution
def main():
  A,B,C,X,Y = list(map(int, input().split()))

  min_cost = 2 * (10 ** 5) * max(A, B, C)

  for i in range(max(X, Y) + 1):
    num_c = 2 * (max(X, Y) - i)
    num_b = max(0, min(Y - num_c // 2, i))
    num_a = max(0, min(X - num_c // 2, i))
    total = A * num_a + B * num_b + C * num_c
    min_cost = min(total, min_cost)

  print(min_cost)

if __name__ == "__main__":
    main()

# Optimized solution
def main():
  A,B,C,X,Y = list(map(int, input().split()))

  min_cost = 2 * (10 ** 5) * max(A, B, C)

  for i in range(max(X, Y) + 1):
    num_c = 2 * (max(X, Y) - i)
    num_b = max(0, Y - num_c // 2)
    num_a = max(0, X - num_c // 2)
    total = A * num_a + B * num_b + C * num_c
    min_cost = min(total, min_cost)

  print(min_cost)

if __name__ == "__main__":
    main()
# Original solution
#  095C
import sys
A,B,C,x,y = list(map(int, sys.stdin.readline().split()))

ans = float('inf')
for i in range(0, 2*max(x, y)+1, 2):
    tmp = A*max(x-i//2, 0) + C*i + B*max(y-i//2, 0)
    #print(tmp, i)
    if ans > tmp:
        ans = tmp
print(ans)

# Optimized solution
#ABC095C
def main():
    import sys, math
    A,B,C,X,Y = list(map(int, sys.stdin.readline().split()))
    L =[]
    #全部C
    L.append(max(X, Y)*2*C)
    
    #できるだけC 不足分A,B
    if X <= Y:
        L +=[X*2*C + (Y-X)*B]
    else:
        L +=[Y*2*C + (X-Y)*A]
    
    #全部A,B
    L.append(A*X+B*Y)
    print((min(L)))


if __name__=='__main__':
    main()
# Original solution
import sys
from collections import deque
from itertools import *


def I(): return int(sys.stdin.readline().rstrip())


def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))


def S(): return sys.stdin.readline().rstrip()


def LS(): return list(sys.stdin.readline().rstrip().split())


A, B, C, X, Y = LI()
avg = (A+B)/2
ans = 0
if avg > C:
    ans += C * min(X, Y) * 2
    if X > Y:
        if A > C * 2:
            ans += C * (X - Y) * 2
        else:
            ans += A * (X - Y)
    elif X < Y:
        if B > C * 2:
            ans += C * (Y - X) * 2
        else:
            ans += B * (Y - X)
    elif X == Y:
        pass
else:
    ans = A * X + B * Y
print(ans)


# Optimized solution
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

A,B,C,X,Y = LI()

ave = (A+B)/2
cost = 0
if ave > C:
    cost += C * min(X,Y) * 2
    if X > Y:
        if A > C * 2:
            cost += C*2*(X-Y)
        else:
            cost += A*(X-Y)
    elif X < Y:
        if B > C * 2:
            cost += C*2*(Y-X)
        else:
            cost += B*(Y-X)
else:
    cost += A*X + B*Y

print(cost)
# Original solution
# -*- coding: utf-8 -*-
import sys

# 標準入力を取得
A, B, C, X, Y = list(map(int, input().split()))

# 求解処理
ans = sys.maxsize
max_c = 2 * max(X, Y)
for c in range(0, max_c + 1, 2):
    a = max(X - c // 2, 0)
    b = max(Y - c // 2, 0)
    price = a * A + b * B + c * C
    ans = min(ans, price)

# 結果出力
print(ans)


# Optimized solution
# -*- coding: utf-8 -*-
import sys


def get_input() -> tuple:
    """
    標準入力を取得する.

    Returns:\n
        tuple: 標準入力
    """
    A, B, C, X, Y = list(map(int, input().split()))

    return A, B, C, X, Y


def main(A: int, B: int, C: int, X: int, Y: int) -> None:
    """
    メイン処理.

    Args:\n
        A (int): Aピザの値段
        B (int): Bピザの値段
        C (int): ABピザの値段
        X (int): Aピザの必要枚数
        Y (int): Bピザの必要枚数
    """
    # 求解処理
    ans = sys.maxsize
    max_c = 2 * max(X, Y)
    for c in range(0, max_c + 1, 2):
        a = max(X - c // 2, 0)
        b = max(Y - c // 2, 0)
        price = a * A + b * B + c * C
        ans = min(ans, price)

    # 結果出力
    print(ans)


if __name__ == "__main__":
    # 標準入力を取得
    A, B, C, X, Y = get_input()

    # メイン処理
    main(A, B, C, X, Y)
# Original solution
def main():
    a, b, c, x, y = list(map(int, input().split()))

    total_min = a * x + b * y

    for i in range(2, max(x, y)*2+1, 2):
        total = a * max(x - i//2, 0) + b * max(y - i//2, 0) + c * i
        total_min = min(total, total_min)
    print(total_min)

if __name__ == "__main__":
    main()

# Optimized solution
def main():
    a, b, c, x, y = list(map(int, input().split()))

    total_min = a * x + b * y

    for i in range(1, max(x, y)+1):
        total = a * max(x - i, 0) + b * max(y - i, 0) + c * i * 2
        total_min = min(total, total_min)
    print(total_min)

if __name__ == "__main__":
    main()
# Original solution
a, b, c, x, y = list(map(int, input().split()))
ab = c * 2

res = float("inf")
if a + b <= ab:
    res = x * a + y * b
else:
    if x == y:
        res = x * ab
    elif x > y:
        for i in range(y, x + 1):
            cost = i * ab + (x - i) * a
            res = min(res, cost)
    else:
        for i in range(x, y + 1):
            cost = i * ab + (y - i) * b
            res = min(res, cost)
print(res)


# Optimized solution
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    a, b, c, x, y = list(map(int, input().split()))
    c *= 2
    if a + b > c:
        cost1 = max(x, y) * c
        cost2 = min(x, y) * c
        plus = ((y - x) * b) if x < y else (x - y) * a
        res = min(cost1, cost2 + plus)
    else:
        res = x * a + y * b
    print(res)

if __name__ == '__main__':
    resolve()
# Original solution
A, B, C, X, Y = list(map(int, input().split()))
sum = 0

while X > 0 or Y > 0:
    if X > 0 and Y > 0:
        if A + B > 2 * C:
            sum += 2 * C
            X -= 1
            Y -= 1
        else:
            sum += A + B
            X -= 1
            Y -= 1
    else:
        if X > 0:
            if A > 2 * C:
                sum += 2 * C
                X -= 1
                Y -= 1
            else:
                sum += A
                X -= 1
        else:
            if B > 2 * C:
                sum += 2 * C
                X -= 1
                Y -= 1
            else:
                sum += B
                Y -= 1

print(sum)


# Optimized solution
A, B, C, X, Y = list(map(int, input().split()))
sum = 0

while X > 0 or Y > 0:
    if X > 0 and Y > 0:
        if A + B > 2 * C:
            sum += 2 * C
        else:
            sum += A + B
        X -= 1
        Y -= 1
    else:
        if X > 0:
            if A > 2 * C:
                sum += 2 * C
            else:
                sum += A
            X -= 1
        else:
            if B > 2 * C:
                sum += 2 * C
            else:
                sum += B
            Y -= 1

print(sum)
# Original solution
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

a, b, c, x, y = na()

ans = 0
while x or y:
    if x and y:
        if a + b > c * 2:
            x -= 1
            y -= 1
            ans += c * 2
        else:
            x -= 1
            y -= 1
            ans += a + b
    else:
        q = c * 2 * (x + y)
        if q <= a * x + b * y:
            ans += c * 2 * (x + y)
            x = 0
            y = 0
        if x:
            ans += a * x
            x = 0
        if y:
            ans += b * y
            y = 0

print(ans)

# Optimized solution
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

a, b, c, x, y = na()

ans = 0
while x or y:
    if x and y:
        if a + b > c * 2:
            z = min(x, y)
            x -= z
            y -= z
            ans += c * 2 * z
        else:
            z = min(x, y)
            x -= z
            y -= z
            ans += (a + b) * z
    else:
        q = c * 2 * (x + y)
        if q <= a * x + b * y:
            ans += c * 2 * (x + y)
            x = 0
            y = 0
        if x:
            ans += a * x
            x = 0
        if y:
            ans += b * y
            y = 0

print(ans)
# Original solution
A, B, C, X, Y = list(map(int, input().split()))
ans = X * A + Y * B
for nab in range(2, max(X, Y) * 2 + 2, 2):
    price = nab * C
    price += max(X - (nab // 2), 0) * A
    price += max(Y - (nab // 2), 0) * B
    ans = min(ans, price)
print(ans)

# Optimized solution
A, B, C, X, Y = list(map(int, input().split()))
ans = None
for ab_count in range(0, max(X, Y) * 2 + 1, 2):
    a_count = max(0, X - ab_count // 2)
    b_count = max(0, Y - ab_count // 2)
    amount = a_count * A + b_count * B + ab_count * C
    if ans is None:
        ans = amount
    else:
        ans = min(ans, amount)
print(ans)
# Original solution
a, b, c, x, y = list(map(int, input().split()))

res = a*x + b*y
for i in range(1, max(x, y)+1):
    ab = i*2
    cand = ab*c + a*max(0, x-i) + b*max(0, y-i)

    res = min(res, cand)

print(res)

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

ans = a*x + b*y
for i in range(1, max(x,y)+1):
    C = 2*i*c + a*max(0,x-i) + b*max(0,y-i)
    ans = min(ans, C)
print(ans)
# Original solution
# https://atcoder.jp/contests/abc095/tasks/arc096_a
"""
別解(定数時間)
https://atcoder.jp/contests/abc095/submissions/10226556
"""

A,B,C,X,Y = list(map(int,input().split()))

ans = float("inf")

# ABピザを2枚1組で考える -> ABセット
# i: ABセットの個数
for i in range(10**5 + 1):
    ans = min(ans, i*(2*C) + max(0, X-i)*A + max(0, Y-i)*B)

print(ans)

# Optimized solution
A,B,C,X,Y = list(map(int,input().split()))

AB_set = C * 2

ans = min(A*X + B*Y, AB_set*max(X,Y), AB_set*min(X,Y) + A*abs(X-min(X,Y)) + B*abs(Y-min(X,Y)))

print(ans)
# Original solution
a, b, c, x, y = list(map(int, input().split()))
val = float('inf')
for k in range(10 ** 5 + 1):
    val = min(val, 2 * c * k + max(x - k, 0) * a + max(y - k, 0) * b)
print(val)

# Optimized solution
A, B, C, X, Y = list(map(int, input().split()))

ans = 0
ans += min(A + B, 2 * C) * min(X, Y)
if X > Y:
    ans += min(A, 2 * C) * (X - Y)
elif X < Y:
    ans += min(B, 2 * C) * (Y - X)
print(ans)
# Original solution
inf = (5000 * 10 ** 5) * 3

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

ret = inf
for cnt_ab in range(max(x, y) * 2 + 1):
    d = cnt_ab // 2

    cnt_a = max(0, x - d)
    cnt_b = max(0, y - d)

    t = cnt_ab * c + cnt_a * a + cnt_b * b
    ret = min(ret, t)
print(ret)


# Optimized solution
def main():
    A, B, AB, X, Y = list(map(int, input().split()))
    M = max(X, Y)

    k = 0
    ans = A * X + B * Y
    while True:
        ans = min(
            ans,
            AB * k * 2 + max(0, X - k) * A + max(0, Y - k) * B
        )

        if k >= M: break
        k += 1

    print(ans)


if __name__ == '__main__':
    main()
# Original solution
def main():
    A, B, AB, X, Y = list(map(int, input().split()))
    M = max(X, Y)

    k = 0
    ans = A * X + B * Y
    while True:
        ans = min(
            ans,
            AB * k * 2 + max(0, X - k) * A + max(0, Y - k) * B
        )

        if k >= M: break
        k += 1

    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    A, B, C, X, Y = list(map(int, input().split()))

    ans = 1 << 30
    c = 0  # even
    while True:
        j = c // 2
        t = A * max(0, X - j) + B * max(0, Y - j) + C * c
        if ans <= t: break
        ans = t
        c += 2

    print(ans)


if __name__ == '__main__':
    main()
# Original solution
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
int1 = lambda x: int(x) - 1
def II(): return int(eval(input()))

def MI(): return list(map(int, input().split()))
def MI1(): return list(map(int1, input().split()))

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def printlist(lst, k='\n'): print((k.join(list(map(str, lst)))))
INF = float('inf')

def solve():
    a, b, c, x, y = MI()

    ans = INF
    for k in range(100001):
        yen = 2 * c * k + max(0, x-k) * a + max(0, y-k) * b
        ans = min(ans, yen)
    print(ans)


if __name__ == '__main__':
    solve()


# Optimized solution
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
int1 = lambda x: int(x) - 1
def II(): return int(eval(input()))

def MI(): return list(map(int, input().split()))
def MI1(): return list(map(int1, input().split()))

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def printlist(lst, k='\n'): print((k.join(list(map(str, lst)))))
INF = float('inf')

def solve():
    a, b, c, x, y = MI()

    ans = 0
    if a + b <= 2 * c:
        mn = min(x, y)
        ans = a * mn + b * mn + max(0, x-mn) * min(a, 2*c) + max(0, y-mn) * min(b, 2*c)

    else:
        mn = min(x, y)
        ans = mn * 2 * c + max(0, x-mn) * min(a, 2*c) + max(0, y-mn) * min(b, 2*c)

    print(ans)



if __name__ == '__main__':
    solve()
# Original solution
a,b,c,x,y=list(map(int,input().split()))

yenmin=a*x+b*y
for zz in range(2*10**5+1):
    xx=max(x-zz//2,0)
    yy=max(y-zz//2,0)
    yen=a*xx+b*yy+c*zz
    if yen<yenmin:
        yenmin=yen
print(yenmin)
#print(xx,yy,zz)

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

cmax=max(x,y)*2
zmin=(a+b)*10**5
for nc in range(0,cmax+1,2):
    na=max(x-nc//2,0)
    nb=max(y-nc//2,0)
    z=a*na+b*nb+c*nc
    zmin=min(zmin,z)
    
print(zmin)
# Original solution
A, B, C, X, Y = list(map(int, input().split()))

# Cを買った個数とA、B単品で買った場合のコストを愚直に試す
total = 1<<60
for i in range(10**5+1):
  cost = 2*C*i + max(X-i, 0)*A + max(Y-i, 0)*B
  total = min(cost, total)

print(total)

# Optimized solution
A, B, C, X, Y = list(map(int, input().split()))

if (A+B) <= 2*C: # 単品だけで購入
  print((X*A + Y*B))
else:
  # ABを買い残りを単品で補う
  if X >= Y:
    # ABでYは賄える
    print((min(X*2*C, Y*2*C + A*(X-Y))))
  else:
    # ABでXは賄える
    print((min(Y*2*C, X*(2*C)+B*(Y-X))))
# Original solution
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    a,b,c,X,Y = LI()
    ans = float("inf")
    for z in range(300001):
        if z%2 == 0:
            m = c*z
            x = z//2
            y = z//2
            m += a*max(0,X-x)
            m += b*max(0,Y-y)
            if m < ans:
                ans = m
    print(ans)
    return

#G
def G():
    n = I()
    x = LI()
    f = [(i,x[i]) for i in range(n)]
    f.sort(key = lambda x:x[1])
    g = [(f[i][0],i) for i in range(n)]
    g.sort(key = lambda x:x[0])
    for i in range(n):
        if g[i][1] < n//2:
            print((f[n//2][1]))
        else:
            print((f[n//2-1][1]))
    return

#H
def H():
    return

#I
def I_():
    return

#J
def J():
    return

#Solve
if __name__ == "__main__":
    F()


# Optimized solution
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    A,B,C,x,y = LI()
    ans = float("inf")
    for c in range(200001)[::2]:
        a = b = c >> 1
        a = max(0,x-a)
        b = max(0,y-b)
        s = A*a+B*b+C*c
        if s < ans:
            ans = s
    print(ans)
    return

#Solve
if __name__ == "__main__":
    solve()
# Original solution
#!/usr/bin/env python3

def main():
    (A,B,C,X,Y) = list(map(int,input().split()))
    lim = max(X, Y)
    vmin = min(X, Y)
    minCost = 5000 * 10**5 * 2
    for t in range(lim+1):
        if t <= vmin:
            cost = (X - t) * A + (Y - t) * B + t * 2 * C
        elif X <= Y:
            cost = (Y - t) * B + t * 2 * C
        else:
            cost = (X - t) * A + t * 2 * C
        minCost = min(minCost, cost)
    print(minCost)
    

main()


# Optimized solution
def main():
    (A,B,C,X,Y) = list(map(int,input().split()))
    if X < Y:
        X, Y = Y, X
        A, B = B, A
    print((min(A + B, 2 * C) * Y + min(A, 2*C) * (X - Y)))

main()
# Original solution
a, b, c, x, y = list(map(int, input().split()))
if a+b <= c*2:
    print((a*x+b*y))
else:
    ans = 10**9
    for i in range(min(x,y)*2, 1+max(x,y)*2, 2):
        xx = x-i/2 if x-i/2 >= 0 else 0
        yy = y-i/2 if y-i/2 >= 0 else 0
        ans = min(ans, int(a*xx+b*yy+c*i))
    print(ans)

# Optimized solution
a, b, c, x, y = list(map(int, input().split()))
print((min(a*x+b*y, c*2*x+b*max(0,y-x), c*2*y+a*max(0,x-y))))
# Original solution
a, b, c, x, y = list(map(int, input().split()))
print((min(a*x+b*y, c*2*x+b*max(0,y-x), c*2*y+a*max(0,x-y))))

# Optimized solution
a, b, c, x, y = list(map(int, input().split()))
print((min(a*x+b*y, a*max(x-y, 0)+b*max(y-x, 0)+c*2*min(x, y), c*2*max(x, y))))
# Original solution
A,B,C,X,Y = list(map(int,input().split()))
achete_A = 0
achete_B = 0
price = 10**100
C = 2 * C #=A,B
for i in range(0,10**5+1):
    price = min(price,i*C + A*max(0,X-i) + B * max(0,Y-i))
print(price)

# Optimized solution
import sys
from sys import stdin


def input(): return stdin.readline().rstrip()


def mips():
    return list(map(int, input().split()))


def ii():
    return int(eval(input()))
A, B, C, X, Y = mips()
money = 0
while X > 0 and Y > 0:
    if (A+B) <= 2*C:
        money += (A+B)
        X -= 1
        Y -= 1
    else:
        money += 2*C
        X -= 1
        Y -= 1
while X > 0:
    if A <= 2*C:
        money += A
        X -= 1
    else:
        money += 2*C
        X -= 1
        Y -= 1
while Y > 0:
    if B <= 2*C:
        money += B
        Y -= 1
    else:
        money += 2*C
        X -= 1
        Y -= 1
print(money)
# Original solution
A,B,C,X,Y=list(map(int,input().split()))
if A>=2*C:
  if B>=2*C:
    print((2*C*max(X,Y)))
    exit()
  else:
    print((2*C*X+B*max(0,(Y-X))))
    exit()
elif B>=2*C:
  print((2*C*Y+A*max(0,(X-Y))))
  exit()
else:
  ans=A*X+B*Y
  for p in range(X):
    for q in range(Y):
      r=max(2*(X-p),2*(Y-q))
      ans=min(ans,A*p+B*q+C*r)
  print(ans)

# Optimized solution
A,B,C,X,Y=list(map(int,input().split()))
if A>=2*C:
  if B>=2*C:
    print((2*C*max(X,Y)))
    exit()
  else:
    print((2*C*X+B*max(0,(Y-X))))
    exit()
elif B>=2*C:
  print((2*C*Y+A*max(0,(X-Y))))
  exit()
else:
  ans=A*X+B*Y
  for i in range(1,min(X,Y)+1):
    p=A*(X-i)+B*(Y-i)+2*C*i
    ans=min(ans,p)
  print(ans)