def bases_overlap(frst, scnd):
    """
    Get the number of overlapping bases.

    :param frst: a tuple representing the first region
                 with chromosome, start, end as the first
                 3 columns
    :param scnd: a tuple representing the second region
                 with chromosome, start, end as the first
                 3 columns
    :return: the number of overlapping bases
    """
    if frst[0] != scnd[0]:
        return 0
    rstart = max(frst[1], scnd[1])
    rend = min(frst[2], scnd[2])
    if rend < rstart:
        return 0
    return rend - rstart