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

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