def calculate_overshoot(cigar):
    """ The calculate overshoot function calculates the number of basepairs that have not been mapped but are part of
    the read.

    :param cigar: a list containing tuples representing the cigar string.
    :return overshoot: an integer indicating the number of basepairs in the read before it is mapped.
    """
    overshoot = 0
    for element in cigar:
        if element[0]:
            overshoot += element[1]
        else:
            break

    return overshoot