a, b, ab, x, y = map(int, input().split())
ave = (a + b) // 2

if ab <= min(a, b) // 2:
    ans = ab * max(x, y) * 2
else:
    if ave <= ab:
        ans = a * x + b * y
    else:
        ans = ab * min(x, y) * 2 + a * (x - min(x, y)) + b * (y - min(x, y))
        
print(ans)