def neutral_tail_length(ref, alt):
    """
    returns index of last non-N(eutral) nucleotide
    :param ref:
    :param alt:
    :return:
    """
    i = len(ref) - 1
    j = len(alt) - 1
    while i >= 0 and ref[i] == 'N' and j >= 0 and alt[j] == 'N':
        i -= 1
        j -= 1
    return len(ref) - i - 1
