def METHOD_NAME(exponent_length: U256, exponent_head: Uint) -> Uint:
    """
    Calculate the number of iterations required to perform a modular
    exponentiation.
    Parameters
    ----------
    exponent_length :
        Length of the array representing the exponent integer.
    exponent_head :
        First 32 bytes of the exponent (with leading zero padding if it is
        shorter than 32 bytes), as an unsigned integer.
    Returns
    -------
    iterations : `Uint`
        Number of iterations.
    """
    if exponent_length <= 32 and exponent_head == 0:
        count = Uint(0)
    elif exponent_length <= 32:
        bit_length = Uint(exponent_head.bit_length())
        if bit_length > 0:
            bit_length -= 1
        count = bit_length
    else:
        length_part = 8 * (Uint(exponent_length) - 32)
        bits_part = Uint(exponent_head.bit_length())
        if bits_part > 0:
            bits_part -= 1
        count = length_part + bits_part
    return max(count, Uint(1))