A,B,C,X,Y = [int(x) for x in input().split()]

ans = A*X+B*Y
for i in [0, 1, max(1,A-1), max(1,A)]:
    for j in [0, 1, max(1,B-1), max(1,B)]:
        ab = max(X-i, Y-j)
        ans = min(ans, A*i + B*j + C*(2*ab))
print(ans)