In this paper, we study the extremal ranks and inertias of the Hermitian matrix expressionf (X, Y) =C4-B4Y- (B4Y)*-A4XA*4’where C4 is Hermitian, *denotes the conjugate transpose, X and Y satisfy the following consistent system of matrix equations A3Y= C3, A1X=C1, XB1=D1, A2XA*2=C2, X=X*. As consequences, we get the necessary and sufficient conditions for the above expression f (X; Y) to be (semi) positive, (semi) negative. The relations between the Hermitian part of the solution to the matrix equation A3Y=C3 and the Hermitian solution to the system of matrix equations A1X=C1, XB1=D1, A2XA*2=C2 are also characterized. Moreover, we give the necessary and sufficient conditions for the solvability to the following system of matrix equations A3Y=C3, A1X=C1, XB1=D1, A2XA*2=C2, X=X*, B4Y+ (B4Y) *+A4XA*4=C4 and provide an expression of the general solution to this system when it is solvable.