

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

if x > y:
  d = x
else:
  d = y

#print(d)

for i in range(x + 1):
    for j in range(y + 1):
        for k in range(2 * d + 1):
            if (i + k / 2 >= x and j + k / 2 >= y):
                price = a * i + b * j + c * k
                p_lists.append(price)      



#print(p_lists)
print(min(p_lists))
