def n_carbon(reaction):
    """number of carbon atoms

    Returns
    -------
    int
        number of carbons for all metabolites involved in a reaction
    """
    return sum(metabolite.elements.get('C', 0) for metabolite in reaction.metabolites)