code: public static int getAtomCount(IMolecularFormula formula) {
  
          int count = 0;
          for (IIsotope isotope : formula.isotopes()) {
              count += formula.getIsotopeCount(isotope);
          }
          return count;
      }
docs: Checks a set of Nodes for the occurrence of each isotopes
  instance in the molecular formula. In short number of atoms.
  
  @param   formula  The MolecularFormula to check
  @return           The occurrence total