a, b, c, x, y = map(int, input().split())
d = x * 2
e = y * 2

num = int(a * x + b * y)
count = 0
for i in range(x + 1):
	for j in range(y + 1):
		k = 0
		m = d - 2 * i
		n = e - 2 * j
		if m >= n:
			k = m
		else:
			k = n
		count = int(i * a + j * b + k * c)
		if num > count:
			num = count

print(num)