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

if a > 2*c and b > 2*c:
    ans = 2*c*max(x, y)
elif a < c and  b < c:
    ans = a*x + b*y
else:
    ans = float('inf')
    for i in range(min(x, y)+1):
        p = 2*c*i + (x-i)*a + (y-i)*b #; print(i, p)
        ans = min(p, ans)
print(ans)