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:
        c=c*2
        print(min(x,y)*c+min(b,c)*(y-x))
    elif a<=c and b>=c:
        c=2*c
        print(min(x,y)*c+min(a,c)*(x-y))
    
    elif a<=c and b<=c:
        print(a*x+b*y)
