def hyperfactorial(k: int) -> int:
    """
    Returns the hyperfactorial of the number, the product of all positive integers to the power of themselves smaller
    or equal to the number.
    By convention an empty product is considered 1, meaning hyperfactorial(0) will return 1.

    :param k: A positive integer
    :return: The hyperfactorial of that integer
    """
    result = 1
    for i in range(1, k + 1):
        result *= i**i
    return result