
'''simple docstring'''



import copy
import importlib.metadata
import json
import os
from dataclasses import dataclass
from typing import Any, Dict, Union

from packaging import version

from ..utils import is_torch_available, logging


if is_torch_available():
	import torch


_SCREAMING_SNAKE_CASE   =      logging.get_logger(__name__)






@dataclass
class 							__lowercase    :







	'''simple docstring'''

	def __init__(self       ,_lowerCamelCase=False       ,_lowerCamelCase=False       ,_lowerCamelCase=6.0       ,_lowerCamelCase=None       ,_lowerCamelCase=False       ,_lowerCamelCase=False       ,_lowerCamelCase=None       ,_lowerCamelCase="fp4"       ,_lowerCamelCase=False       ,**_lowerCamelCase       ,)							->							List[Any]:







				'''simple docstring'''





				__lowercase			  =							load_in_abit
				__lowercase			  =							load_in_abit
				__lowercase			  =							llm_inta_threshold
				__lowercase			  =							llm_inta_skip_modules
				__lowercase			  =							llm_inta_enable_fpaa_cpu_offload
				__lowercase			  =							llm_inta_has_fpaa_weight
				__lowercase			  =							bnb_abit_quant_type
				__lowercase			  =							bnb_abit_use_double_quant

				if bnb_abit_compute_dtype is None:
							__lowercase			  =							torch.floataa
				elif isinstance(_lowerCamelCase       ,_lowerCamelCase	):
							__lowercase			  =							getattr(_lowerCamelCase       ,_lowerCamelCase	)
				elif isinstance(_lowerCamelCase       ,torch.dtype	):
							__lowercase			  =							bnb_abit_compute_dtype
				else:
							raise ValueError('''bnb_4bit_compute_dtype must be a string or a torch.dtype'''	)

				self.post_init()


	def   _UpperCAmelCase       (self	)							->							Union[str, Any]:







				'''simple docstring'''





				if not isinstance(self.llm_inta_threshold       ,_lowerCamelCase	):
							raise ValueError('''llm_int8_threshold must be a float'''	)

				if self.llm_inta_skip_modules is not None and not isinstance(self.llm_inta_skip_modules       ,_lowerCamelCase	):
							raise ValueError('''llm_int8_skip_modules must be a list of strings'''	)
				if not isinstance(self.llm_inta_enable_fpaa_cpu_offload       ,_lowerCamelCase	):
							raise ValueError('''llm_int8_enable_fp32_cpu_offload must be a boolean'''	)

				if not isinstance(self.llm_inta_has_fpaa_weight       ,_lowerCamelCase	):
							raise ValueError('''llm_int8_has_fp16_weight must be a boolean'''	)

				if self.bnb_abit_compute_dtype is not None and not isinstance(self.bnb_abit_compute_dtype       ,torch.dtype	):
							raise ValueError('''bnb_4bit_compute_dtype must be torch.dtype'''	)

				if not isinstance(self.bnb_abit_quant_type       ,_lowerCamelCase	):
							raise ValueError('''bnb_4bit_quant_type must be a string'''	)

				if not isinstance(self.bnb_abit_use_double_quant       ,_lowerCamelCase	):
							raise ValueError('''bnb_4bit_use_double_quant must be a boolean'''	)

				if self.load_in_abit and not version.parse(importlib.metadata.version('''bitsandbytes'''	)	) >= version.parse(
				    '''0.39.0'''	):
							raise ValueError(
							    '''4 bit quantization requires bitsandbytes>=0.39.0 - please upgrade your bitsandbytes version'''	)


	def   _UpperCAmelCase       (self	)							->							int:







				'''simple docstring'''





				return self.load_in_abit or self.load_in_abit


	def   _UpperCAmelCase       (self	)							->							Optional[Any]:







				'''simple docstring'''





				if self.load_in_abit:
							return "llm_int8"
				elif self.load_in_abit and self.bnb_abit_quant_type == "fp4":
							return "fp4"
				elif self.load_in_abit and self.bnb_abit_quant_type == "nf4":
							return "nf4"
				else:
							return None


	@classmethod
	def   _UpperCAmelCase       (cls       ,_lowerCamelCase       ,_lowerCamelCase       ,**_lowerCamelCase	)							->							Optional[int]:







				'''simple docstring'''





				__lowercase			  =							cls(**_lowerCamelCase	)

				__lowercase			  =							[]
				for key, value in kwargs.items():
							if hasattr(_lowerCamelCase       ,_lowerCamelCase	):
										setattr(_lowerCamelCase       ,_lowerCamelCase       ,_lowerCamelCase	)
										to_remove.append(_lowerCamelCase	)
				for key in to_remove:
							kwargs.pop(_lowerCamelCase       ,_lowerCamelCase	)

				if return_unused_kwargs:
							return config, kwargs
				else:
							return config


	def   _UpperCAmelCase       (self       ,_lowerCamelCase	)							->							Union[str, Any]:







				'''simple docstring'''





				with open(_lowerCamelCase       ,'''w'''       ,encoding='''utf-8'''	) as writer:
							__lowercase			  =							self.to_dict()
							__lowercase			  =							json.dumps(_lowerCamelCase       ,indent=2       ,sort_keys=_lowerCamelCase	) + '''\n'''

							writer.write(_lowerCamelCase	)


	def   _UpperCAmelCase       (self	)							->							Dict[str, Any]:







				'''simple docstring'''





				__lowercase			  =							copy.deepcopy(self.__dict__	)
				__lowercase			  =							str(output['''bnb_4bit_compute_dtype''']	).split('''.'''	)[1]

				return output


	def __repr__(self	)							->							int:







				'''simple docstring'''





				return f"{self.__class__.__name__} {self.to_json_string()}"


	def   _UpperCAmelCase       (self       ,_lowerCamelCase = True	)							->							str:







				'''simple docstring'''





				if use_diff is True:
							__lowercase			  =							self.to_diff_dict()
				else:
							__lowercase			  =							self.to_dict()
				return json.dumps(_lowerCamelCase       ,indent=2       ,sort_keys=_lowerCamelCase	) + "\n"


	def   _UpperCAmelCase       (self	)							->							Dict[str, Any]:







				'''simple docstring'''





				__lowercase			  =							self.to_dict()

				# get the default config dict
				__lowercase			  =							BitsAndBytesConfig().to_dict()

				__lowercase			  =							{}

				# only serialize values that differ from the default config
				for key, value in config_dict.items():
							if value != default_config_dict[key]:
										__lowercase			  =							value

				return serializable_config_dict












'''simple docstring'''



from math import sqrt




def 				_lowerCAmelCase  (			lowerCamelCase_     :					int			):
			__lowercase			  =							0
			for i in range(1						,    int(sqrt(lowerCamelCase_			) + 1			)			):
						if n % i == 0 and i != sqrt(lowerCamelCase_			):
									total += i + n // i
						elif i == sqrt(lowerCamelCase_			):
									total += i
			return total - n




def 				_lowerCAmelCase  (			lowerCamelCase_     :					int = 1_0_0_0_0			):
			__lowercase			  =							sum(
			    i
			    for i in range(1						,    lowerCamelCase_			)
			    if sum_of_divisors(sum_of_divisors(lowerCamelCase_			)			) == i and sum_of_divisors(lowerCamelCase_			) != i			)
			return total


if __name__ == "__main__":
	print(solution(int(str(input()).strip())))





