#n = int(input())
a,b,c,x,y = map(int,input().split())
#a_L = list(map(int,input().split()))

price = 500*10**5*2+1
for i in range(100001):
    price = min(price,i*2*c + max(0,x-i)*a +  max(0,y-i)*b)

print(price)
