






'''simple docstring'''
# This code is adapted from OpenAI's release
# https://github.com/openai/human-eval/blob/master/human_eval/execution.py

import contextlib
import faulthandler
import io
import multiprocessing
import os
import platform
import signal
import tempfile





def 	_a(					UpperCamelCase__			:  int,		UpperCamelCase__			:  List[Any],		UpperCamelCase__			:  Optional[Any],		UpperCamelCase__			:  Dict							):




      '''simple docstring'''






      SCREAMING_SNAKE_CASE__       :			List[str]													=multiprocessing.Manager()
      SCREAMING_SNAKE_CASE__       :			List[Any]													=manager.list()

      SCREAMING_SNAKE_CASE__       :			Optional[Any]													=multiprocessing.Process(target=UpperCamelCase__,		args=(check_program, result, timeout)							)
      p.start()
      p.join(timeout=timeout + 1							)
      if p.is_alive():
            p.kill()

      if not result:
            result.append('''timed out'''							)

      return {
          "task_id": task_id,
          "passed": result[0] == "passed",
          "result": result[0],
          "completion_id": completion_id,
      }





def 	_a(					UpperCamelCase__			:  Dict,		UpperCamelCase__			:  Optional[int],		UpperCamelCase__			:  List[Any]							):




      '''simple docstring'''






      with create_tempdir():
            # These system calls are needed when cleaning up tempdir.
            import os
            import shutil

            SCREAMING_SNAKE_CASE__       :			int													=shutil.rmtree
            SCREAMING_SNAKE_CASE__       :			List[Any]													=os.rmdir
            SCREAMING_SNAKE_CASE__       :			List[str]													=os.chdir

            # Disable functionalities that can make destructive changes to the test.
            reliability_guard()

            # Run program.
            try:
                  SCREAMING_SNAKE_CASE__       :			Any													={}
                  with swallow_io():
                        with time_limit(UpperCamelCase__							):
                              exec(UpperCamelCase__,		UpperCamelCase__							)
                  result.append('''passed'''							)
            except TimeoutException:
                  result.append('''timed out'''							)
            except BaseException as e:
                  result.append(f"failed: {e}"							)

            # Needed for cleaning up.
            SCREAMING_SNAKE_CASE__       :			Optional[Any]													=rmtree
            SCREAMING_SNAKE_CASE__       :			Union[str, Any]													=rmdir
            SCREAMING_SNAKE_CASE__       :			Tuple													=chdir





@contextlib.contextmanager
def 	_a(					UpperCamelCase__			:  Tuple							):




      '''simple docstring'''






      def signal_handler(UpperCamelCase__			:  Any,		UpperCamelCase__			:  int							):
            raise TimeoutException('''Timed out!'''							)

      signal.setitimer(signal.ITIMER_REAL,		UpperCamelCase__							)
      signal.signal(signal.SIGALRM,		UpperCamelCase__							)
      try:
            yield
      finally:
            signal.setitimer(signal.ITIMER_REAL,		0							)





@contextlib.contextmanager
def 	_a(					):




      '''simple docstring'''






      SCREAMING_SNAKE_CASE__       :			Any													=WriteOnlyStringIO()
      with contextlib.redirect_stdout(UpperCamelCase__							):
            with contextlib.redirect_stderr(UpperCamelCase__							):
                  with redirect_stdin(UpperCamelCase__							):
                        yield





@contextlib.contextmanager
def 	_a(					):




      '''simple docstring'''






      with tempfile.TemporaryDirectory() as dirname:
            with chdir(UpperCamelCase__							):
                  yield dirname






class        __SCREAMING_SNAKE_CASE (     lowerCamelCase			):
 pass






class        __SCREAMING_SNAKE_CASE (     io.StringIO			):




 def        __magic_name__		( self		:							str   , *__lowercase		:							int   , **__lowercase		:							List[str] )		->  Optional[Any]:
       raise OSError




 def        __magic_name__		( self		:							str   , *__lowercase		:							List[Any]   , **__lowercase		:							List[Any] )		->  Dict:
       raise OSError




 def        __magic_name__		( self		:							Optional[int]   , *__lowercase		:							Union[str, Any]   , **__lowercase		:							int )		->  str:
       raise OSError




 def        __magic_name__		( self		:							Optional[Any]   , *__lowercase		:							Optional[Any]   , **__lowercase		:							Tuple )		->  Optional[int]:
       return False






class        __SCREAMING_SNAKE_CASE (     contextlib._RedirectStream			):  # type: ignore
 snake_case_												=							"""stdin"""





@contextlib.contextmanager
def 	_a(					UpperCamelCase__			:  List[Any]							):




      '''simple docstring'''






      if root == ".":
            yield
            return
      SCREAMING_SNAKE_CASE__       :			str													=os.getcwd()
      os.chdir(UpperCamelCase__							)
      try:
            yield
      except BaseException as exc:
            raise exc
      finally:
            os.chdir(UpperCamelCase__							)







def 	_a(					UpperCamelCase__			:  str=None							):




      '''simple docstring'''






      if maximum_memory_bytes is not None:
            import resource

            resource.setrlimit(resource.RLIMIT_AS,		(maximum_memory_bytes, maximum_memory_bytes)							)
            resource.setrlimit(resource.RLIMIT_DATA,		(maximum_memory_bytes, maximum_memory_bytes)							)
            if not platform.uname().system == "Darwin":
                  resource.setrlimit(resource.RLIMIT_STACK,		(maximum_memory_bytes, maximum_memory_bytes)							)

      faulthandler.disable()

      import builtins

      SCREAMING_SNAKE_CASE__       :			Optional[Any]													=None
      SCREAMING_SNAKE_CASE__       :			Optional[int]													=None

      import os

      SCREAMING_SNAKE_CASE__       :			Dict													='''1'''

      SCREAMING_SNAKE_CASE__       :			List[Any]													=None
      SCREAMING_SNAKE_CASE__       :			int													=None
      SCREAMING_SNAKE_CASE__       :			List[str]													=None
      SCREAMING_SNAKE_CASE__       :			Tuple													=None
      SCREAMING_SNAKE_CASE__       :			str													=None
      SCREAMING_SNAKE_CASE__       :			Dict													=None
      SCREAMING_SNAKE_CASE__       :			Optional[Any]													=None
      SCREAMING_SNAKE_CASE__       :			str													=None
      SCREAMING_SNAKE_CASE__       :			Optional[int]													=None
      SCREAMING_SNAKE_CASE__       :			List[str]													=None
      SCREAMING_SNAKE_CASE__       :			Union[str, Any]													=None
      SCREAMING_SNAKE_CASE__       :			Any													=None
      SCREAMING_SNAKE_CASE__       :			Any													=None
      SCREAMING_SNAKE_CASE__       :			int													=None
      SCREAMING_SNAKE_CASE__       :			Optional[int]													=None
      SCREAMING_SNAKE_CASE__       :			Any													=None
      SCREAMING_SNAKE_CASE__       :			Union[str, Any]													=None
      SCREAMING_SNAKE_CASE__       :			Optional[Any]													=None
      SCREAMING_SNAKE_CASE__       :			List[str]													=None
      SCREAMING_SNAKE_CASE__       :			int													=None
      SCREAMING_SNAKE_CASE__       :			Tuple													=None
      SCREAMING_SNAKE_CASE__       :			Dict													=None
      SCREAMING_SNAKE_CASE__       :			int													=None
      SCREAMING_SNAKE_CASE__       :			str													=None
      SCREAMING_SNAKE_CASE__       :			List[str]													=None
      SCREAMING_SNAKE_CASE__       :			str													=None
      SCREAMING_SNAKE_CASE__       :			List[str]													=None

      import shutil

      SCREAMING_SNAKE_CASE__       :			str													=None
      SCREAMING_SNAKE_CASE__       :			List[Any]													=None
      SCREAMING_SNAKE_CASE__       :			str													=None

      import subprocess

      SCREAMING_SNAKE_CASE__       :			Optional[int]													=None  # type: ignore

      SCREAMING_SNAKE_CASE__       :			Union[str, Any]													=None

      import sys

      SCREAMING_SNAKE_CASE__       :			int													=None
      SCREAMING_SNAKE_CASE__       :			List[str]													=None
      SCREAMING_SNAKE_CASE__       :			Dict													=None
      SCREAMING_SNAKE_CASE__       :			Optional[int]													=None
      SCREAMING_SNAKE_CASE__       :			Union[str, Any]													=None







'''simple docstring'''
from math import factorial





def 	_a(					UpperCamelCase__			:  int = 1_0_0							):




      '''simple docstring'''






      return sum(int(UpperCamelCase__							) for x in str(factorial(UpperCamelCase__							)							)							)


if __name__ == "__main__":
  print(solution(int(input('Enter the Number: ').strip())))