How many rearrangements of the letters of "$HMMTHMMT$" do not contain the substring "$HMMT$"? (For instance, one such arrangement is $HMMHMTMT$.)

Let's think step by step and output the final answer within \boxed{}.
user