Exercise

Suppose that A is finite of size n. What is the number of words of length d in the free monoid over A?