code: public static int getAtomCount(IChemModel chemModel) {
          int count = 0;
          ICrystal crystal = chemModel.getCrystal();
          if (crystal != null) {
              count += crystal.getAtomCount();
          }
          IAtomContainerSet moleculeSet = chemModel.getMoleculeSet();
          if (moleculeSet != null) {
              count += MoleculeSetManipulator.getAtomCount(moleculeSet);
          }
          IReactionSet reactionSet = chemModel.getReactionSet();
          if (reactionSet != null) {
              count += ReactionSetManipulator.getAtomCount(reactionSet);
          }
          return count;
      }
docs: Get the total number of atoms inside an IChemModel.
  
  @param chemModel  The IChemModel object.
  @return           The number of Atom object inside.