def get_atoms_per_fu(doc):
    """ Calculate and return the number of atoms per formula unit.

    Parameters:
        doc (list/dict): structure to evaluate OR matador-style stoichiometry.

    """
    if 'stoichiometry' in doc:
        return sum([elem[1] for elem in doc['stoichiometry']])
    return sum([elem[1] for elem in doc])