Reduces strings as far as possible by replacing ab with c, ac with b, and bc with a. Then returns the length of that string.