import copy


def rhyme_quality( p1, p2 ):
    """ Determine a numerical quality of the rhyme between two pronunciation lists. 
    
        >>> rhyme_quality( ["A", "B", "C"], ["A", "B"] )
        0
        >>> rhyme_quality( ["A", "B", "C"], ["B", "C"] )
        2
        >>> rhyme_quality( ["A", "B"], ["A", "B"] )
        0
        >>> rhyme_quality( ["B", "B", "C", "D"], ["A", "B", "C", "D"] )
        #3
    """
    p1 = copy.deepcopy(p1)
    p2 = copy.deepcopy(p2)
    p1.reverse()
    p2.reverse()
    if p1 == p2:
        # G-Spot rocks the G-Spot
        return 0
    quality = 0
    for i, p_chunk in enumerate(p1):
        try:
            if p_chunk == p2[i]:
                quality += 1
            if p_chunk != p2[i]:
                break
        except IndexError:
            break
    return quality