def overlap(interval1, interval2):
    """
    Returns the total amount of overlap between two intervals in the format of (x,y)

    Example:
        input:      (0,10) , (5,10)
        returns:    5  
    """
    return max(0, min(interval1[1], interval2[1]) - max(interval1[0], interval2[0]))