Well I wrote out by hand AAA, AAB, ABB, ABA, BAA, BAB, BBA, BBB which is 2^3, then I can see it's either 3A 0B, 3B 0A, 2A 1B, or 1A 2B. Which is four ways.
Just trying to determine what is needed if I generalize this to say an alphabet of k elements and string of n length.