The volume of the resulting solid will be the volume of one rectangular prism times n.
The the volume of a rectangular prism is V=lwh. But since l=w (cross-section is a square), we now have V=l²h.
The volume of the resulting solid will be V = nl²h or V = nw²h.