def compute_score_shift(nEM, nLM, nR, c, nEMX, nLMX):
    """
    Compute constant shift for RF score as described in FastMulRFS paper

    Parameters
    ----------
    nEM : int
          Number of edges in MUL-tree
    nLM : int
          Number of leaves in MUL-tree
    nR : int
         Number of edges in MUL-tree that induce invalid bipartitions
         (i.e., edges split the label set into two non-disjoint sets)
    c : int
        Number of species with multiple copies in the MUL-tree
    nEMX : int
           Number of edges in preprocessed MUL-tree
    nLMX : int
           Number of leaves in preprocessed MUL-tree,
           which is the same as the number of species

    Returns
    -------
    Constant shift for RF score as described in FastMulRFS paper
    """
    return nLMX + c + nEM - nEMX - (2 * nR) - nLM