a,b,c,x,y=map(int,input().split())

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