
    Given a patient's vital signs monitoring sequence of length 2n, where each measurement is recorded as either stable (1) or unstable (0), with n readings taken during admission and n readings before discharge, determine how many possible monitoring sequences exist where the count of stable readings during admission equals the count of stable readings before discharge.
    

    
def count_binary_seq(n):
    """
    Given a patient's vital signs monitoring sequence of length 2n, where each measurement is recorded as either stable (1) or unstable (0), with n readings taken during admission and n readings before discharge, determine how many possible monitoring sequences exist where the count of stable readings during admission equals the count of stable readings before discharge.
    

    """
def count_binary_seq(n):
    """
    Given a patient's vital signs monitoring sequence of length 2n, where each measurement is recorded as either stable (1) or unstable (0), with n readings taken during admission and n readings before discharge, determine how many possible monitoring sequences exist where the count of stable readings during admission equals the count of stable readings before discharge.
    

    """
    nCr = 1
    res = 1
    for r in range(1, n + 1):
        nCr = nCr * (n + 1 - r) / r
        res += nCr * nCr
    return res