The number of molecules in Gibbs is an input parameter. Usually you want a sufficient number of molecules to reduce finite size effects (like 256 or 512) in liquid/vapor equilibrium Gibbs.
In case of adsorption, you need more molecules that the saturation loading in the framework plus then enough molecules in the vapor phase.