We provide a formula that expresses the number of $(n-2)$-gaps of a generic digital $n$-object. Such a formula has the advantage to involve only a few simple intrinsic parameters of the object and it is obtained by using a combinatorial technique based on incidence structure and on the notion of free cells. This approach seems suitable as a model for an automatic computation, and also allow us to find some expressions for the maximum number of $i$-cells that bound or are bounded by a fixed $j$-cell.