In Digital Geometry, a gap is a location of a digital object through which a discrete ray can penetrate with no intersection. More specifically, for a 3D digital object we distinguish between 0- and 1-gaps depending on the relative position of such a ray. Although in some applications it is important to know how many gaps has a set of voxels, it is quite complicated to find an efficient algorithm to directly count them. We provide a formula that states the number of 1-gaps of a generic 3D object using the notion of free cell of dimension 1 and 2.