def multiplicity(p, n):
    """
    Return the multiplicity of the number p in n; that is, the greatest
    number m such that p**m divides n.

    Example usage
    =============
        >>> multiplicity(5, 8)
        0
        >>> multiplicity(5, 5)
        1
        >>> multiplicity(5, 25)
        2
        >>> multiplicity(5, 125)
        3
        >>> multiplicity(5, 250)
        3
    """
    m = 0
    quot, rem = divmod(n, p)
    while rem == 0:
        quot, rem = divmod(quot, p)
        m += 1
    return m