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

if A + B < 2 * C:
    print(A*X + B*Y)

elif A > 2 * C or B > 2 * C:
    print(2*C*max(X, Y))

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