def factorial(n: int) -> int:
    """This function is for calculating n-factorial element

    Args:
        n (int): input, which element you want to calculate

    Returns:
        int: calculated n-factorial element
    """

    if n < 1:
        return 1
    else:
        return n * factorial(n - 1)