a, b, c, x, y = map(int, input().split())
ans = 0

z = min(x, y)
if (a + b) // 2 > c:
    ans += z * c * 2
    x, y = x - z, y - z

for d, z in ((a, x), (b, y)):
    if d // 2 > c:
        ans += z * c * 2
    else:
        ans += d * z

print(ans)