def get_transition_n_bdg(transitions, tax, from_ds, to_ds):
    """Return the number of buildings in the transition."""
    filter_1 = transitions[transitions.taxonomy == tax]
    filter_2 = filter_1[filter_1.from_damage_state == from_ds]
    filter_3 = filter_2[filter_2.to_damage_state == to_ds]

    return filter_3.n_buildings.iloc[0]