Note that corresponding to the permutation of 10 distinct objects, while you have two groups of object in which they are indistinguishable within group.

Therefore you need to reduce the duplicated one by dividing which result in the answer.

When x=3 the string has to start MMM.
When x=8 the string has to end MMM, so by symmetry P(x=3) = P(x=8)
Likewise P(x=4) = P(x=7) and P(x=5) = P(x=6)
That should save some calculations.