


# 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 				UpperCAmelCase_					(							__snake_case     ,						__snake_case     ,						__snake_case     ,						__snake_case						)     ->			Dict:







 """simple docstring"""


 _lowercase							      =multiprocessing.Manager()
 _lowercase							      =manager.list()

 _lowercase							      =multiprocessing.Process(target=__a     ,						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 				UpperCAmelCase_					(							__snake_case     ,						__snake_case     ,						__snake_case						)     ->			Union[str, Any]:







 """simple docstring"""


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

  _lowercase							      =shutil.rmtree
  _lowercase							      =os.rmdir
  _lowercase							      =os.chdir

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

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

  # Needed for cleaning up.
  _lowercase							      =rmtree
  _lowercase							      =rmdir
  _lowercase							      =chdir
@contextlib.contextmanager
def 				UpperCAmelCase_					(							__snake_case						)     ->			Dict:







 """simple docstring"""


 def signal_handler(__snake_case     ,						__snake_case						):
  raise TimeoutException('''Timed out!'''						)

 signal.setitimer(signal.ITIMER_REAL     ,						__a						)
 signal.signal(signal.SIGALRM     ,						__a						)
 try:
  yield
 finally:
  signal.setitimer(signal.ITIMER_REAL     ,						0						)
@contextlib.contextmanager
def 				UpperCAmelCase_					(							)     ->			Union[str, Any]:







 """simple docstring"""


 _lowercase							      =WriteOnlyStringIO()
 with contextlib.redirect_stdout(__a						):
  with contextlib.redirect_stderr(__a						):
   with redirect_stdin(__a						):
    yield
@contextlib.contextmanager
def 				UpperCAmelCase_					(							)     ->			Dict:







 """simple docstring"""


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







class       lowerCamelCase__   (       lowerCAmelCase):
     pass







class       lowerCamelCase__   (       io.StringIO):





     def      __A					(self		,     *UpperCAmelCase		,     **UpperCAmelCase       )     ->   Dict:
      raise OSError





     def      __A					(self		,     *UpperCAmelCase		,     **UpperCAmelCase       )     ->   str:
      raise OSError





     def      __A					(self		,     *UpperCAmelCase		,     **UpperCAmelCase       )     ->   int:
      raise OSError





     def      __A					(self		,     *UpperCAmelCase		,     **UpperCAmelCase       )     ->   int:
      return False







class       lowerCamelCase__   (       contextlib._RedirectStream):  # type: ignore
     SCREAMING_SNAKE_CASE__      			=			'''stdin'''



@contextlib.contextmanager
def 				UpperCAmelCase_					(							__snake_case						)     ->			List[str]:







 """simple docstring"""


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



def 				UpperCAmelCase_					(							__snake_case=None						)     ->			Dict:







 """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

 _lowercase							      =None
 _lowercase							      =None

 import os

 _lowercase							      ='''1'''

 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None

 import shutil

 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None

 import subprocess

 _lowercase							      =None  # type: ignore

 _lowercase							      =None

 import sys

 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None
 _lowercase							      =None








from math import ceil







def    __lowerCamelCase					(							__a   :int = 1_0_0_1    )		->				int:






		"""simple docstring"""

		A__        =   1

		for i in range(1    ,     int(ceil(n / 2.0    )    )    ):
				A__        =   2 * i + 1
				A__        =   2 * i
				A__        =   total + 4 * odd**2 - 6 * even

		return total


if __name__ == "__main__":
					import sys

					if len(sys.argv) == 1:
										print(solution())
					else:
										try:
															A    :					List[str] =      int(sys.argv[1])
															print(solution(n))
										except ValueError:
															print('''Invalid entry - please enter a number''')



