a,b,c,x,y=map(int,input().split())
if a+b>2*c and a<2*c and b<2*c:
    if x>y:
        print(y*c*2+a*(x-y))
    else:
        print(x*c*2+b*(y-x))
elif a+b<2*c:
    print(a*x+b*y)
elif a>2*c and b>2*c:
    print(max(x,y)*2*c)
elif a>2*c:
    if x<y:
        print(max(x,y)*2*c)
    else:
        print(min(x,y)*2*c+(x-y)*a)
else:
    if x>y:
        print(max(x,y)*2*c)
    else:
        print(min(x,y)*2*c+(y-x)*b)
