Problem

Source:

Tags: combinatorics



A string of letters is called $good$ if it contains a continuous substring $IMONST$ in it. For example, the string $NSIMONSTIM$ is $good$, but the string $IMONNNST$ is not. Find the number of good strings consisting of $12$ letters from $I$, $M$, $O$, $N$, $S$, $T$ only.