a, b, c, x, y = map(int, input().split())
if (a >= 2 * c and b >= 2 * c): print(max(x, y) * 2 * c)
elif (a + b <= 2 * c): print(a * x + b * y)
elif (x > y): print((x - 1) * 2 * c + a)
elif (y < x): print((y - 1) * 2 * c + b)
else: print(2 * c * x)
