



"""simple docstring"""







import importlib.metadata
import subprocess
import sys

def 							UpperCamelCase_       (       lowerCAmelCase__ :							bool = False		)		->  str:

  """simple docstring"""




  lowerCAmelCase_  :							List[Any]								=					False
  if "IPython" in sys.modules:
    lowerCAmelCase_  :							Any								=					'google.colab' in str(sys.modules['IPython'].get_ipython()		)

  if in_colab:
    if upgrade:
      lowerCAmelCase_  :							int								=					['pip', 'install', '-U', 'torch']
      subprocess.run(lowerCAmelCase__       ,  check=lowerCAmelCase__		)
    # get the current version of torch
    lowerCAmelCase_  :							str								=					importlib.metadata.version('torch'		)
    lowerCAmelCase_  :							Any								=					torch_version[: torch_version.rindex('.'		)]
    lowerCAmelCase_  :							int								=					f"https://storage.googleapis.com/tpu-pytorch/wheels/colab/torch_xla-{torch_version_trunc}-cp37-cp37m-linux_x86_64.whl"
    lowerCAmelCase_  :							Union[str, Any]								=					['pip', 'install', xla_wheel]
    subprocess.run(lowerCAmelCase__       ,  check=lowerCAmelCase__		)
  else:
    raise RuntimeError('`install_xla` utility works only on google colab.'		)










"""simple docstring"""







def 							UpperCamelCase_       (       lowerCAmelCase__ :							int = 400_0000		)		->  int:

  """simple docstring"""




  if n <= 1:
    return 0
  lowerCAmelCase_  :							Union[str, Any]								=					0
  lowerCAmelCase_  :							Tuple								=					2
  lowerCAmelCase_  :							List[Any]								=					0
  while 4 * b + a <= n:
    lowerCAmelCase_		,lowerCAmelCase_  :							str								=					b, 4 * b + a
    count += a
  return count + b


if __name__ == "__main__":
     print(f'{solution() = }')





