If we are to find all the permutations where S has to come together, we can simply assume all the S's( 4 S's ) to be just one character. Then all S would come together.
So, now there r 7 characters( M, P, 4 I's and a single S ).
So, number of permutations = 7!/4!
Again, the question asks us to find out the numbers where none of the I's would come together.
So, we've to just find the number of such combinations where I's come together.
Now, likewise, we'ld think that all the I's are also a single I.
So, the number of characters is: 4( M, P, only a solitary I and a solitary S ) and all of them r distinct characters.
So, number of such characters : 4!
So, answer is = 7!/4! - 4!