def multiplicative_order(n: int, m: int) -> int:
    """Get multiplicative order of `n` modulo `m`

    Args:
        n, m: Numbers

    Returns:
        Order of n in the multiplicative group of the units in the ring of the integers modulo m

    Examples:
        >>> print(multiplicative_order(16, 7))
        3

    """
    i, k = 1, n
    while k != 1 and i < m:
        k = k * n % m
        i += 1
    return i