from collections import OrderedDict
from typing import Any, List, Mapping, Optional

from ... import PreTrainedTokenizer, TensorType, is_torch_available
from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfigWithPast, PatchingSpec
from ...utils import logging


_UpperCAmelCase		:       int						    =	logging.get_logger(__name__)

_UpperCAmelCase		:       Optional[Any]						    =	{
    """EleutherAI/gpt-j-6B""": """https://huggingface.co/EleutherAI/gpt-j-6B/resolve/main/config.json""",
    # See all GPT-J models at https://huggingface.co/models?filter=gpt_j
}







class 			lowercase    (	__UpperCamelCase      ):
				__SCREAMING_SNAKE_CASE :			Union[str, Any]	      =      "gptj"
				__SCREAMING_SNAKE_CASE :			Optional[Any]	      =      {
				    "max_position_embeddings": "n_positions",
				    "hidden_size": "n_embd",
				    "num_attention_heads": "n_head",
				    "num_hidden_layers": "n_layer",
				}




				def __init__( self				,       snake_case=5_0400				,       snake_case=2048				,       snake_case=4096				,       snake_case=28				,       snake_case=16				,       snake_case=64				,       snake_case=None				,       snake_case="gelu_new"				,       snake_case=0.0				,       snake_case=0.0				,       snake_case=0.0				,       snake_case=1e-5				,       snake_case=0.02				,       snake_case=True				,       snake_case=5_0256				,       snake_case=5_0256				,       snake_case=False				,       **snake_case				,       ):
											snake_case_          =   vocab_size
											snake_case_          =   n_positions
											snake_case_          =   n_embd
											snake_case_          =   n_layer
											snake_case_          =   n_head
											snake_case_          =   n_inner
											snake_case_          =   rotary_dim
											snake_case_          =   activation_function
											snake_case_          =   resid_pdrop
											snake_case_          =   embd_pdrop
											snake_case_          =   attn_pdrop
											snake_case_          =   layer_norm_epsilon
											snake_case_          =   initializer_range
											snake_case_          =   use_cache

											snake_case_          =   bos_token_id
											snake_case_          =   eos_token_id

											super().__init__(
											    bos_token_id=_lowerCAmelCase				,       eos_token_id=_lowerCAmelCase				,       tie_word_embeddings=_lowerCAmelCase				,       **_lowerCAmelCase	)







class 			lowercase    (	__UpperCamelCase      ):




				def __init__( self				,       snake_case				,       snake_case = "default"				,       snake_case = None				,       snake_case = False				,       ):
											super().__init__(_lowerCAmelCase				,       task=_lowerCAmelCase				,       patching_specs=_lowerCAmelCase				,       use_past=_lowerCAmelCase	)
											if not getattr(self._config				,       'pad_token_id'				,       _lowerCAmelCase	):
																		# TODO: how to do that better?
																		snake_case_          =   0




				@property
				def    a							( self	):
											snake_case_          =   OrderedDict({'input_ids': {0: 'batch', 1: 'sequence'}}	)
											if self.use_past:
																		self.fill_with_past_key_values_(_lowerCAmelCase				,       direction='inputs'	)
																		snake_case_          =   {0: """batch""", 1: """past_sequence + sequence"""}
											else:
																		snake_case_          =   {0: """batch""", 1: """sequence"""}

											return common_inputs




				@property
				def    a							( self	):
											return self._config.n_layer




				@property
				def    a							( self	):
											return self._config.n_head




				def    a							( self				,       snake_case				,       snake_case = -1				,       snake_case = -1				,       snake_case = False				,       snake_case = None				,       ):
											snake_case_          =   super(_lowerCAmelCase				,       self	).generate_dummy_inputs(
											    _lowerCAmelCase				,       batch_size=_lowerCAmelCase				,       seq_length=_lowerCAmelCase				,       is_pair=_lowerCAmelCase				,       framework=_lowerCAmelCase	)

											# We need to order the input in the way they appears in the forward()
											snake_case_          =   OrderedDict({'input_ids': common_inputs['input_ids']}	)

											# Need to add the past_keys
											if self.use_past:
																		if not is_torch_available():
																									raise ValueError('Cannot generate dummy past_keys inputs without PyTorch installed.'	)
																		else:
																									import torch

																									snake_case_          =   common_inputs["""input_ids"""].shape
																									# Not using the same length for past_key_values
																									snake_case_          =   seqlen + 2
																									snake_case_          =   (
																									    batch,
																									    self.num_attention_heads,
																									    past_key_values_length,
																									    self._config.hidden_size // self.num_attention_heads,
																									)
																									snake_case_          =   [
																									    (torch.zeros(_lowerCAmelCase	), torch.zeros(_lowerCAmelCase	)) for _ in range(self.num_layers	)
																									]

											snake_case_          =   common_inputs["""attention_mask"""]
											if self.use_past:
																		snake_case_          =   ordered_inputs["""attention_mask"""].dtype
																		snake_case_          =   torch.cat(
																		    [ordered_inputs['attention_mask'], torch.ones(_lowerCAmelCase				,       _lowerCAmelCase				,       dtype=_lowerCAmelCase	)]				,       dim=1	)

											return ordered_inputs




				@property
				def    a							( self	):
											return 13







from math import sqrt





def  __lowerCamelCase     (			UpperCamelCase__				):







							'''simple docstring'''






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





def  __lowerCamelCase     (			UpperCamelCase__ = 10000				):







							'''simple docstring'''






							snake_case_          =   sum(
							    i
							    for i in range(1       ,							UpperCamelCase__				)
							    if sum_of_divisors(sum_of_divisors(UpperCamelCase__				)				) == i and sum_of_divisors(UpperCamelCase__				) != i				)
							return total


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




