6. (20 points) We will call a word any finite sequence of letters of the Russian alphabet. How many different five-letter words can be formed from the letters of the word САМСА? And from the letters of the word ПАСТА? In your answer, indicate the sum of the found numbers.
Answer: 90.

Solution: In the word SAMSA, the letter A appears twice and the letter S appears twice. Therefore, the number of different words will be $\frac{5!}{2!\cdot 2!}=30$. In the word PASTA, only the letter A appears twice. Therefore, the number of different words in this case will be $\frac{5!}{2!}=60$. In total, we get $30+60=90$.