code: public static final int getNrGroups(Structure s) {
  		int nrGroups = 0;
  
  		List<Chain> chains = s.getChains(0);
  		for (Chain c : chains) {
  			nrGroups += c.getAtomLength();
  		}
  		return nrGroups;
  	}
docs: Count how many groups are contained within a structure object.
  
  @param s
  the structure object
  @return the number of groups in the structure