piza = list(map(int,input().split()))
half = False
sum = 0
if(piza[0] >= piza[2] and piza[1] >= piza[2]):
	sum += piza[2] * max(piza[3],piza[4]) * 2
	print(sum)
	exit()
elif(piza[0]+piza[1]>piza[2]*2):
	half = True
if(half == True):
	sum += min(piza[3],piza[4])*piza[2]*2
	if(piza[3] > piza[4]):
		sum += (piza[3]-piza[4])*piza[0]
	else:
		sum += (piza[4]-piza[3])*piza[1]
else:
	sum += piza[0] * piza[3] + piza[1] * piza[4]
print(sum)