since A1 has dimension m*n
A2 has dimension p*q
A3 has dimension q*r
A4 has dimension r*s
A5 has dimension m*n
(A1 A2 A3 A4 A5)m*s so it is equal to =
( ( ( ( A1*A2 )*A3 ) *A4 )*A5 )
so here we found that we need 4 pair of parenthesis for full pair of parenthesization.