def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a,b,c,x,y = i2()
if a+b > 2*c:
	z = min(x,y)//2
	print( a*(x-2*z)+b*(y-2*z)+c*4*z)
else:
	print( a*x+b*y )