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)
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)

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)

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)

-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) +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)