Add a macro to count the number of pieces on a board.