6. A chocolate bar consists of $5 \times 8$ square pieces. The bar is broken along straight lines, separating the pieces until 40 individual pieces are obtained. How many times will the bar need to be broken?
6. To get 40 equal pieces from a chocolate bar, you first need to divide it into 8 strips along its length. For this, 7 breaks are required. Then, each of the 8 strips needs to be divided into 5 pieces. For this, 4 breaks are needed in each strip. In total, the chocolate bar will need to be broken 28 times $(7 \times 4=28)$.

Answer: 28 times.