A,B,C,X,Y=list(map(int,input().split()))



if 2*C<A+B:

  print((2*C*min(X,Y)+(min(2*C,A)*(X-Y) if X>=Y else min(2*C,B)*(Y-X))))

else:

  print((A*X+B*Y))

A,B,C,X,Y=list(map(int,input().split()))

D,E=min(2*C,A),min(2*C,B)



if 2*C<A+B:

  print((2*C*min(X,Y)+((X-Y)*D if X>=Y else E*(Y-X))))

else:

  print((A*X+B*Y))

A, B, C, X, Y = list(map(int, input().split()))
if 2 * C < A + B:
    print(
        (
            2 * C * min(X, Y)
            + (min(2 * C, A) * (X - Y) if X >= Y else min(2 * C, B) * (Y - X))
        )
    )
else:
    print((A * X + B * Y))

A, B, C, X, Y = list(map(int, input().split()))
D, E = min(2 * C, A), min(2 * C, B)
if 2 * C < A + B:
    print((2 * C * min(X, Y) + ((X - Y) * D if X >= Y else E * (Y - X))))
else:
    print((A * X + B * Y))

+D, E = min(2 * C, A), min(2 * C, B) -    print( -        ( -            2 * C * min(X, Y) -            + (min(2 * C, A) * (X - Y) if X >= Y else min(2 * C, B) * (Y - X)) -        ) -    ) +    print((2 * C * min(X, Y) + ((X - Y) * D if X >= Y else E * (Y - X))))