def byteLength(n: int) -> int:
    """Returns minimal amount of bytes to write given number

    Parameters:
        n: int

    Returns:
        result: int
            minimal amount of bytes to write n
    """
    return (n.bit_length() + 7) // 8