from typing import Iterable


def natural_prefix_len(values: Iterable[int]) -> int:
    """Counts the consecutive integers from 1 to n from the start of values."""
    index = 0
    for index, value in enumerate(values):
        if value - 1 != index:
            break
    return index