We can permute M,I,I,I,I,P,P in 4!2!7! ways. Corresponding to each arrangement of these seven letters, we have 8 places where S can be arranged as shown below with X. X□X□X□X□X□X□X□
We can choose 4 places out of 8 in 8C4 ways. Thus, the required number of ways =(8C4)(4!2!7!)=(7)(8C4)(6C4)