
"""simple docstring"""






import copy
import os
from typing import Union

from ...configuration_utils import PretrainedConfig
from ...utils import logging


_lowerCamelCase     =  logging.get_logger(__name__)

_lowerCamelCase     =  {
    'google/pix2struct-textcaps-base': (
        'https://huggingface.co/google/pix2struct-textcaps-base/resolve/main/config.json'
    ),
}


class 			lowerCamelCase_		(			lowercase   ):





				"""simple docstring"""







				_lowerCAmelCase      :      Tuple      							=					"pix2struct_text_model"
				_lowerCAmelCase      :      List[Any]      							=					["past_key_values"]
				_lowerCAmelCase      :      Optional[int]      							=					{
				    "hidden_size": "hidden_size",
				    "num_attention_heads": "num_heads",
				    "num_hidden_layers": "num_layers",
				}



				def __init__(						self       ,		UpperCAmelCase__=5_0244       ,		UpperCAmelCase__=768       ,		UpperCAmelCase__=64       ,		UpperCAmelCase__=2048       ,		UpperCAmelCase__=12       ,		UpperCAmelCase__=12       ,		UpperCAmelCase__=32       ,		UpperCAmelCase__=128       ,		UpperCAmelCase__=0.1       ,		UpperCAmelCase__=1e-6       ,		UpperCAmelCase__=1.0       ,		UpperCAmelCase__="gelu_new"       ,		UpperCAmelCase__=0       ,		UpperCAmelCase__=False       ,		UpperCAmelCase__=0       ,		UpperCAmelCase__=1       ,		UpperCAmelCase__=False       ,		UpperCAmelCase__=True       ,		**UpperCAmelCase__       ,		):
								SCREAMING_SNAKE_CASE__     							=				vocab_size
								SCREAMING_SNAKE_CASE__     							=				hidden_size
								SCREAMING_SNAKE_CASE__     							=				d_kv
								SCREAMING_SNAKE_CASE__     							=				d_ff
								SCREAMING_SNAKE_CASE__     							=				num_layers
								SCREAMING_SNAKE_CASE__     							=				num_heads
								SCREAMING_SNAKE_CASE__     							=				relative_attention_num_buckets
								SCREAMING_SNAKE_CASE__     							=				relative_attention_max_distance
								SCREAMING_SNAKE_CASE__     							=				dropout_rate
								SCREAMING_SNAKE_CASE__     							=				layer_norm_epsilon
								SCREAMING_SNAKE_CASE__     							=				initializer_factor
								SCREAMING_SNAKE_CASE__     							=				use_cache

								SCREAMING_SNAKE_CASE__     							=				eos_token_id
								SCREAMING_SNAKE_CASE__     							=				decoder_start_token_id

								# for backwards compatibility
								SCREAMING_SNAKE_CASE__     							=				dense_act_fn

								super().__init__(
								    pad_token_id=UpperCAmelCase__       ,		eos_token_id=UpperCAmelCase__       ,		decoder_start_token_id=UpperCAmelCase__       ,		tie_word_embeddings=UpperCAmelCase__       ,		is_decoder=UpperCAmelCase__       ,		**UpperCAmelCase__       ,		)






				@classmethod
				def   lowerCAmelCase__		(						cls       ,		UpperCAmelCase__       ,		**UpperCAmelCase__     ):
								cls._set_token_in_kwargs(UpperCAmelCase__     )

								SCREAMING_SNAKE_CASE__							,      SCREAMING_SNAKE_CASE__     							=				cls.get_config_dict(UpperCAmelCase__       ,		**UpperCAmelCase__     )

								# get the text config dict if we are loading from Pix2StructConfig
								if config_dict.get("model_type"     ) == "pix2struct":
												SCREAMING_SNAKE_CASE__     							=				config_dict["text_config"]

								if "model_type" in config_dict and hasattr(cls       ,		"model_type"     ) and config_dict["model_type"] != cls.model_type:
												logger.warning(
												    f'''You are using a model of type {config_dict["model_type"]} to instantiate a model of type '''
												    f'''{cls.model_type}. This is not supported for all configurations of models and can yield errors.'''     )

								return cls.from_dict(UpperCAmelCase__       ,		**UpperCAmelCase__     )


class 			lowerCamelCase_		(			lowercase   ):





				"""simple docstring"""







				_lowerCAmelCase      :      int      							=					"pix2struct_vision_model"



				def __init__(						self       ,		UpperCAmelCase__=768       ,		UpperCAmelCase__=768       ,		UpperCAmelCase__=2048       ,		UpperCAmelCase__=64       ,		UpperCAmelCase__=12       ,		UpperCAmelCase__=12       ,		UpperCAmelCase__="gelu_new"       ,		UpperCAmelCase__=1e-6       ,		UpperCAmelCase__=0.0       ,		UpperCAmelCase__=0.0       ,		UpperCAmelCase__=1e-10       ,		UpperCAmelCase__=1.0       ,		UpperCAmelCase__=4096       ,		UpperCAmelCase__=32       ,		UpperCAmelCase__=128       ,		**UpperCAmelCase__       ,		):
								super().__init__(**UpperCAmelCase__     )

								SCREAMING_SNAKE_CASE__     							=				hidden_size
								SCREAMING_SNAKE_CASE__     							=				patch_embed_hidden_size
								SCREAMING_SNAKE_CASE__     							=				d_ff
								SCREAMING_SNAKE_CASE__     							=				dropout_rate
								SCREAMING_SNAKE_CASE__     							=				num_hidden_layers
								SCREAMING_SNAKE_CASE__     							=				num_attention_heads
								SCREAMING_SNAKE_CASE__     							=				initializer_range
								SCREAMING_SNAKE_CASE__     							=				initializer_factor
								SCREAMING_SNAKE_CASE__     							=				attention_dropout
								SCREAMING_SNAKE_CASE__     							=				layer_norm_eps
								SCREAMING_SNAKE_CASE__     							=				dense_act_fn
								SCREAMING_SNAKE_CASE__     							=				seq_len
								SCREAMING_SNAKE_CASE__     							=				relative_attention_num_buckets
								SCREAMING_SNAKE_CASE__     							=				relative_attention_max_distance
								SCREAMING_SNAKE_CASE__     							=				d_kv






				@classmethod
				def   lowerCAmelCase__		(						cls       ,		UpperCAmelCase__       ,		**UpperCAmelCase__     ):
								cls._set_token_in_kwargs(UpperCAmelCase__     )

								SCREAMING_SNAKE_CASE__							,      SCREAMING_SNAKE_CASE__     							=				cls.get_config_dict(UpperCAmelCase__       ,		**UpperCAmelCase__     )

								# get the vision config dict if we are loading from Pix2StructConfig
								if config_dict.get("model_type"     ) == "pix2struct":
												SCREAMING_SNAKE_CASE__     							=				config_dict["vision_config"]

								if "model_type" in config_dict and hasattr(cls       ,		"model_type"     ) and config_dict["model_type"] != cls.model_type:
												logger.warning(
												    f'''You are using a model of type {config_dict["model_type"]} to instantiate a model of type '''
												    f'''{cls.model_type}. This is not supported for all configurations of models and can yield errors.'''     )

								return cls.from_dict(UpperCAmelCase__       ,		**UpperCAmelCase__     )


class 			lowerCamelCase_		(			lowercase   ):





				"""simple docstring"""







				_lowerCAmelCase      :      Optional[Any]      							=					"pix2struct"
				_lowerCAmelCase      :      List[Any]      							=					True



				def __init__(						self       ,		UpperCAmelCase__=None       ,		UpperCAmelCase__=None       ,		UpperCAmelCase__=1.0       ,		UpperCAmelCase__=0.02       ,		UpperCAmelCase__=False       ,		UpperCAmelCase__=False       ,		UpperCAmelCase__=True       ,		**UpperCAmelCase__       ,		):
								super().__init__(tie_word_embeddings=UpperCAmelCase__       ,		is_encoder_decoder=UpperCAmelCase__       ,		**UpperCAmelCase__     )

								if text_config is None:
												SCREAMING_SNAKE_CASE__     							=				{}
												logger.info("text_config is None. Initializing the Pix2StructTextConfig with default values."     )

								if vision_config is None:
												SCREAMING_SNAKE_CASE__     							=				{}
												logger.info("vision_config is None. Initializing the Pix2StructVisionConfig with default values."     )

								SCREAMING_SNAKE_CASE__     							=				PixaStructTextConfig(**UpperCAmelCase__     )
								SCREAMING_SNAKE_CASE__     							=				PixaStructVisionConfig(**UpperCAmelCase__     )

								SCREAMING_SNAKE_CASE__     							=				self.text_config.decoder_start_token_id
								SCREAMING_SNAKE_CASE__     							=				self.text_config.pad_token_id
								SCREAMING_SNAKE_CASE__     							=				self.text_config.eos_token_id

								SCREAMING_SNAKE_CASE__     							=				initializer_factor
								SCREAMING_SNAKE_CASE__     							=				initializer_range

								SCREAMING_SNAKE_CASE__     							=				self.initializer_range
								SCREAMING_SNAKE_CASE__     							=				self.initializer_range

								SCREAMING_SNAKE_CASE__     							=				is_vqa



				@classmethod
				def   lowerCAmelCase__		(						cls       ,		UpperCAmelCase__       ,		UpperCAmelCase__       ,		**UpperCAmelCase__     ):
								return cls(text_config=text_config.to_dict()       ,		vision_config=vision_config.to_dict()       ,		**UpperCAmelCase__     )






				def   lowerCAmelCase__		(						self     ):
								SCREAMING_SNAKE_CASE__     							=				copy.deepcopy(self.__dict__     )
								SCREAMING_SNAKE_CASE__     							=				self.text_config.to_dict()
								SCREAMING_SNAKE_CASE__     							=				self.vision_config.to_dict()
								SCREAMING_SNAKE_CASE__     							=				self.__class__.model_type
								return output




"""simple docstring"""






from math import sqrt


def __lowercase     (      lowerCamelCase_  :      int  ):
				SCREAMING_SNAKE_CASE__     							=				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 __lowercase     (      lowerCamelCase_  :      int = 10000  ):
				SCREAMING_SNAKE_CASE__     							=				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())))
