def digit_that_breaks_ordering_index(digits: list) -> int:
    """
    Starting from last digit of given number, find the first
    digit which breaks the sorted ordering. Let the index of
    this found digit be 'i' and the digit be number[i].

    :param digits: list of digits
    :return: the index of the first digit which breaks the sorted ordering
    """
    i: int = -1
    for index in range(len(digits) - 1, -1, -1):
        if index - 1 >= 0 and digits[index] > digits[index - 1]:
            return index - 1
    return i if i >= 0 else 0