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

for i in range(x+y):
    if i%2!=0:
        continue
    if (i//2)>=x:
        a_p = 0
        b_p = b*(y-(i//2))
    if (i//2)>=y:
        a_p = a*(x-(i//2))
        b_p = 0
    else:
        a_p = a*(x-(i//2))
        b_p = b*(y-(i//2))
        
    price = (c*i)+ a_p + b_p
    l.append(price)

print(min(l))