from typing import Iterable


def prefix_length(x: Iterable, y: Iterable) -> int:
    """
    Determines the length of any common prefix shared by the iterables ``x``
    and ``y``.
    """
    l = 0
    for i, j in zip(x, y):
        if i != j:
            break
        l += 1
    return l