This is a numerical-answer question. The correct answer is shown below.
[Solution by Dr. Abubacker] The letters available are the five distinct letters M, A, T, H, S, each used at least twice if used. Patterns by letter counts: $(2,2,2)$: $\binom53\frac{6!}{2!2!2!}=900$; $(3,3)$: $\binom52\frac{6!}{3!3!}=200$; $(2,4)$: $5\cdot4\cdot\frac{6!}{2!4!}=300$; $(6)$: $5$. Total $=900+200+300+5=1405$. Answer: 1405.