A page of an exercise book is painted with $23$ colors, arranged in squares. A pair of colors is called \textit{good} if there are neighboring squares painted with these colors. What is the minimum number of good pairs?

Let's think step by step and output the final answer within \boxed{}.
user