from typing import Tuple


def _calculate_fold_number(length: int, max_length: int, folding: bool) -> Tuple[int, int]:
    """Calculate the number of the folded and unfolded items.

    Arguments:
        length: The object length.
        max_length: The configured max length.
        folding: Whether fold the "repr" of the object.

    Returns:
        The number of the folded items & the number of the unfolded items.

    """
    if folding and length > max_length:
        return length - max_length + 1, max_length - 2
    return 0, length