def checkdims(dims: tuple):
    """
    Calculate the total number of elements

    :param dims: Dimension tuple
    :type dims: tuple
    :return: Number of elements
    :rtype: int
    """
    number: int = 1

    def multipy(dim: int):
        nonlocal number
        number = number * dim
    for dim in dims:
        multipy(dim)
    return int(number)