a,b,c,x,y = map(int,input().split())
d = a*x + b*y
e = 0
f = 0
g = 0
h = 0
if x > y and y % 2 == 0:
    e = c*2*y + a*(x-y)
elif x > y and y % 2 != 0:
    f = c*2*(y-1) + b + a*(x-y+1)
elif x < y and x % 2 == 0:
    g = c*2*x + b*(y-x)
elif x < y and x % 2 != 0:
    h = c*2*(x-1) + a + b*(y-x+1)
l = [d,e,f,g,h]
print(sorted(l)[3])