input: Write a function to count the number of anagrams of a given word.
  assert anagrams_count("a") == 1
  assert anagrams_count("ab") == 2
  assert anagrams_count("abc") == 6
  assert anagrams_count("aaa") == 1
output: def anagrams_count(word):
      from math import factorial
      from collections import Counter
  
      letter_counts = Counter(word)
      denominator = 1
      for count in letter_counts.values():
          denominator *= factorial(count)
      
      return factorial(len(word)) // denominator