Rui has a chocolate bar that is arranged into the shape of a grid of squares. Rui can break up the chocolate bar in any way he wants horizontally or vertically at each step. The goal is to obtain the constituent squares. What is the minimum number of breaks Rui must perform? Report the answer for and .