def vertical_key2simplified_vertical_key(vertical_key):
    """
    Simplifies a given reaction key by replacing specific reaction and product clusters by their numbers.
    :param vertical_key: tuple (ubiquitous_reactants, ubiquitous_products,
    specific_reactant_classes, specific_product_classes) -- reaction key
    :return: simplified vertical key (ubiquitous_reactants, ubiquitous_products,
    number_of_specific_reactant_classes, number_of_specific_product_classes)
    """
    u_rs, u_ps, rs, ps = vertical_key
    s_rs = u_rs, len(rs)
    s_ps = u_ps, len(ps)
    if s_rs > s_ps:
        s_rs, s_ps = s_ps, s_rs
    return s_rs, s_ps
