from __future__ import annotations


def 	lowerCamelCase					(	UpperCamelCase     :				List[Any]							)   ->    int:

		# preprocessing the first row
		for i in range(1			,       len(matrix[0]							)							):
				matrix[0][i] += matrix[0][i - 1]

		# preprocessing the first column
		for i in range(1			,       len(_A							)							):
				matrix[i][0] += matrix[i - 1][0]

		# updating the path cost for current position
		for i in range(1			,       len(_A							)							):
				for j in range(1			,       len(matrix[0]							)							):
						matrix[i][j] += min(matrix[i - 1][j]			,       matrix[i][j - 1]							)

		return matrix[-1][-1]


if __name__ == "__main__":
				import doctest

				doctest.testmod()







"""simple docstring"""







def      UpperCamelCase       ( _A  ,				_A )     ->       int:
				lowercase    :      int       = 1  # To kept the Calculated Value
				# Since C(n, k) = C(n, n-k)
				if k > (n - k):
								lowercase    :      List[Any]       = n - k
				# Calculate C(n,k)
				for i in range(_A ):
								result *= n - i
								result //= i + 1
				return result


def      UpperCamelCase       ( _A )     ->       int:
				return binomial_coefficient(2 * node_count  ,				_A ) // (node_count + 1)


def      UpperCamelCase       ( _A )     ->       int:
				if n < 0:
								raise ValueError("""factorial() not defined for negative values""" )
				lowercase    :      Union[str, Any]       = 1
				for i in range(1  ,				n + 1 ):
								result *= i
				return result


def      UpperCamelCase       ( _A )     ->       int:
				return catalan_number(_A ) * factorial(_A )


if __name__ == "__main__":
				_lowerCAmelCase            =	int(input('Enter the number of nodes: ').strip() or 0)
				if node_count <= 0:
								raise ValueError('We need some nodes to work with.')
				print(
				    F'Given {node_count} nodes, there are {binary_tree_count(node_count)} '
				    F'binary trees and {catalan_number(node_count)} binary search trees.'
				)
