
from __future__ import annotations

from typing import Any







class 				lowercase		:




							def __init__(				self   ,A__ = 6):
												lowercase							=						None
												lowercase							=						None
												self.create_linked_list(A__)




							def  A__      (				self   ,A__):
												lowercase							=						Node()
												lowercase							=						current_node
												lowercase							=						current_node
												lowercase							=						current_node
												for _ in range(1   ,A__):
																	lowercase							=						Node()
																	lowercase							=						current_node
																	lowercase							=						previous_node
																	lowercase							=						current_node
												lowercase							=						self.front
												lowercase							=						previous_node




							def  A__      (				self):
												return (
												    self.front == self.rear
												    and self.front is not None
												    and self.front.data is None
												)




							def  A__      (				self):
												self.check_can_perform_operation()
												return self.front.data if self.front else None




							def  A__      (				self   ,A__):
												if self.rear is None:
																	return

												self.check_is_full()
												if not self.is_empty():
																	lowercase							=						self.rear.next
												if self.rear:
																	lowercase							=						data




							def  A__      (				self):
												self.check_can_perform_operation()
												if self.rear is None or self.front is None:
																	return None
												if self.front == self.rear:
																	lowercase							=						self.front.data
																	lowercase							=						None
																	return data

												lowercase							=						self.front
												lowercase							=						old_front.next
												lowercase							=						old_front.data
												lowercase							=						None
												return data




							def  A__      (				self):
												if self.is_empty():
																	raise Exception('''Empty Queue''')





							def  A__      (				self):
												if self.rear and self.rear.next == self.front:
																	raise Exception('''Full Queue''')







class 				lowercase		:




							def __init__(				self):
												lowercase							=						None
												lowercase							=						None
												lowercase							=						None


if __name__ == "__main__":
							import doctest

							doctest.testmod()





'''simple docstring'''




def 	UpperCamelCase_							(					_UpperCAmelCase  :      int			,	_UpperCAmelCase  :      int    )    ->    int:


       """simple docstring"""







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

def 	UpperCamelCase_							(					_UpperCAmelCase  :      int    )    ->    int:


       """simple docstring"""







       return binomial_coefficient(2 * node_count			,	_UpperCAmelCase    ) // (node_count + 1)

def 	UpperCamelCase_							(					_UpperCAmelCase  :      int    )    ->    int:


       """simple docstring"""







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

def 	UpperCamelCase_							(					_UpperCAmelCase  :      int    )    ->    int:


       """simple docstring"""







       return catalan_number(_UpperCAmelCase    ) * factorial(_UpperCAmelCase    )


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

