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

k = max(x,y)
minman = 9999999999999

k = k // 2
for i in range(k,-1,-1):
    now_x = x
    now_y = y
    ans = c * (i * 4)
    now_x = now_x - (i * 2)
    now_y = now_y - (i * 2)
    if now_x < 0:
        now_x = 0
    if now_y < 0:
        now_y = 0
    ans +=( now_x * a ) + ( now_y * b)
    if minman > ans:
        minman = ans
print(minman)