a, b, c, x, y = map(int, input().split())
A = (a, x)
B = (b, y)
ans = 0
if A[0]+B[0] > 2*c:
    mn = min(A, B, key=lambda x: x[1])
    mx = max(A, B, key=lambda x: x[1])
    q, r = divmod(mn[1], 2)
    e1 = 2*q * 2*c + mn[0] * r + (mx[1]-2*q) * mx[0]
    e2 = mx[1] * 2*c
    ans = min(e1, e2)
else:
    ans += A[0]*A[1] + B[0]*B[1]

print(ans)
