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