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

out=10**6
for c in range(2*(10**5)+1):
    if c%2==0:
        a = X - c//2
        b = Y - c//2
        cost = A*a + B*b + C*c

        if cost>=0 and a>=0 and b>=0:
            # print('a,b,c,cost:',a,b,c,cost)
            out=min(out,cost)
print(out)
