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






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






def 					snake_case    (			snake_case__     :List[str])		->  int:


       if n < 0:
              raise ValueError("""factorial() not defined for negative values""")
       _A	  =    1
       for i in range(1  ,      n + 1):
              result *= i
       return result






def 					snake_case    (			snake_case__     :Union[str, Any])		->  int:
       return catalan_number(snake_case__) * factorial(snake_case__)


if __name__ == "__main__":
    _SCREAMING_SNAKE_CASE     				=		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.'''
    )







"""simple docstring"""




from typing import List

from .keymap import KEYMAP, get_character

def 						A							(  snake_case__     ):




			'''simple docstring'''


			def decorator(snake_case__     ):
						SCREAMING_SNAKE_CASE__										=   getattr(snake_case__		,					"""handle_key"""		,					[]     )
						handle += [key]
						setattr(snake_case__		,					"""handle_key"""		,					snake_case__     )
						return func

			return decorator

def 						A							(  *snake_case__     ):




			'''simple docstring'''


			def decorator(snake_case__     ):
						SCREAMING_SNAKE_CASE__										=   getattr(snake_case__		,					"""handle_key"""		,					[]     )
						handle += keys
						setattr(snake_case__		,					"""handle_key"""		,					snake_case__     )
						return func

			return decorator





class  lowerCamelCase    (A__      ):

			def __new__(       cls					:    Dict     ,					__UpperCAmelCase					:    Tuple     ,					__UpperCAmelCase					:    Any     ,					__UpperCAmelCase					:    Optional[Any]							) ->     List[str]:
						SCREAMING_SNAKE_CASE__										=   super().__new__(cls     ,					__UpperCAmelCase     ,					__UpperCAmelCase     ,					__UpperCAmelCase							)
						if not hasattr(__UpperCAmelCase     ,					"""key_handler"""							):
									setattr(__UpperCAmelCase     ,					"""key_handler"""     ,					{}							)
						setattr(__UpperCAmelCase     ,					"""handle_input"""     ,					KeyHandler.handle_input							)

						for value in attrs.values():
									SCREAMING_SNAKE_CASE__										=   getattr(__UpperCAmelCase     ,					"""handle_key"""     ,					[]							)
									for key in handled_keys:
												SCREAMING_SNAKE_CASE__										=   value
						return new_cls





			@staticmethod
			def        SCREAMING_SNAKE_CASE					(       cls					:    Tuple							) ->     Dict:
						SCREAMING_SNAKE_CASE__										=   get_character()
						if char != KEYMAP["undefined"]:
									SCREAMING_SNAKE_CASE__										=   ord(__UpperCAmelCase							)
						SCREAMING_SNAKE_CASE__										=   cls.key_handler.get(__UpperCAmelCase							)
						if handler:
									SCREAMING_SNAKE_CASE__										=   char
									return handler(cls							)
						else:
									return None

def 						A							(  cls     ):




			'''simple docstring'''


			return KeyHandler(cls.__name__		,					cls.__bases__		,					cls.__dict__.copy()     )


