



'''simple docstring'''

import unittest

from transformers import AutoTokenizer, NystromformerConfig, is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
							import torch

							from transformers import (
							    NystromformerForMaskedLM,
							    NystromformerForMultipleChoice,
							    NystromformerForQuestionAnswering,
							    NystromformerForSequenceClassification,
							    NystromformerForTokenClassification,
							    NystromformerModel,
							)
							from transformers.models.nystromformer.modeling_nystromformer import NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST

class      __magic_name__						:







							def __init__(							self :	Dict     ,_UpperCAmelCase :	Optional[int]     ,_UpperCAmelCase :	int=13     ,_UpperCAmelCase :	Optional[Any]=7     ,_UpperCAmelCase :	Optional[Any]=True     ,_UpperCAmelCase :	Tuple=True     ,_UpperCAmelCase :	Union[str, Any]=True     ,_UpperCAmelCase :	int=True     ,_UpperCAmelCase :	List[str]=99     ,_UpperCAmelCase :	Any=32     ,_UpperCAmelCase :	Dict=5     ,_UpperCAmelCase :	str=4     ,_UpperCAmelCase :	Optional[int]=37     ,_UpperCAmelCase :	Union[str, Any]="gelu"     ,_UpperCAmelCase :	int=0.1     ,_UpperCAmelCase :	Any=0.1     ,_UpperCAmelCase :	str=512     ,_UpperCAmelCase :	List[Any]=16     ,_UpperCAmelCase :	Any=2     ,_UpperCAmelCase :	Dict=0.02     ,_UpperCAmelCase :	Tuple=3     ,_UpperCAmelCase :	str=4     ,_UpperCAmelCase :	Union[str, Any]=None     ,):
									_a					:				List[Any]				=							parent
									_a					:				List[str]				=							batch_size
									_a					:				int				=							seq_length
									_a					:				Optional[Any]				=							is_training
									_a					:				List[str]				=							use_input_mask
									_a					:				Any				=							use_token_type_ids
									_a					:				Dict				=							use_labels
									_a					:				Optional[Any]				=							vocab_size
									_a					:				str				=							hidden_size
									_a					:				Optional[int]				=							num_hidden_layers
									_a					:				Optional[Any]				=							num_attention_heads
									_a					:				int				=							intermediate_size
									_a					:				Tuple				=							hidden_act
									_a					:				int				=							hidden_dropout_prob
									_a					:				Union[str, Any]				=							attention_probs_dropout_prob
									_a					:				List[Any]				=							max_position_embeddings
									_a					:				Any				=							type_vocab_size
									_a					:				Any				=							type_sequence_label_size
									_a					:				int				=							initializer_range
									_a					:				Optional[int]				=							num_labels
									_a					:				Any				=							num_choices
									_a					:				Union[str, Any]				=							scope







							def 							__lowercase      (							self :	List[str]		):
									_a					:				Dict				=							ids_tensor([self.batch_size, self.seq_length]     ,self.vocab_size		)

									_a					:				Dict				=							None
									if self.use_input_mask:
											_a					:				str				=							random_attention_mask([self.batch_size, self.seq_length]		)

									_a					:				Optional[Any]				=							None
									if self.use_token_type_ids:
											_a					:				Tuple				=							ids_tensor([self.batch_size, self.seq_length]     ,self.type_vocab_size		)

									_a					:				Union[str, Any]				=							None
									_a					:				int				=							None
									_a					:				str				=							None
									if self.use_labels:
											_a					:				int				=							ids_tensor([self.batch_size]     ,self.type_sequence_label_size		)
											_a					:				Union[str, Any]				=							ids_tensor([self.batch_size, self.seq_length]     ,self.num_labels		)
											_a					:				List[Any]				=							ids_tensor([self.batch_size]     ,self.num_choices		)

									_a					:				Dict				=							self.get_config()

									return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels







							def 							__lowercase      (							self :	Any		):
									return NystromformerConfig(
									    vocab_size=self.vocab_size     ,hidden_size=self.hidden_size     ,num_hidden_layers=self.num_hidden_layers     ,num_attention_heads=self.num_attention_heads     ,intermediate_size=self.intermediate_size     ,hidden_act=self.hidden_act     ,hidden_dropout_prob=self.hidden_dropout_prob     ,attention_probs_dropout_prob=self.attention_probs_dropout_prob     ,max_position_embeddings=self.max_position_embeddings     ,type_vocab_size=self.type_vocab_size     ,is_decoder=_UpperCAmelCase     ,initializer_range=self.initializer_range     ,)







							def 							__lowercase      (							self :	Any     ,_UpperCAmelCase :	Union[str, Any]     ,_UpperCAmelCase :	Dict     ,_UpperCAmelCase :	int     ,_UpperCAmelCase :	Union[str, Any]     ,_UpperCAmelCase :	Dict     ,_UpperCAmelCase :	Tuple     ,_UpperCAmelCase :	List[Any]		):
									_a					:				Dict				=							NystromformerModel(config=_UpperCAmelCase		)
									model.to(_UpperCAmelCase		)
									model.eval()
									_a					:				str				=							model(_UpperCAmelCase     ,attention_mask=_UpperCAmelCase     ,token_type_ids=_UpperCAmelCase		)
									_a					:				List[str]				=							model(_UpperCAmelCase     ,token_type_ids=_UpperCAmelCase		)
									_a					:				Dict				=							model(_UpperCAmelCase		)
									self.parent.assertEqual(result.last_hidden_state.shape     ,(self.batch_size, self.seq_length, self.hidden_size)		)







							def 							__lowercase      (							self :	Tuple     ,_UpperCAmelCase :	Any     ,_UpperCAmelCase :	Any     ,_UpperCAmelCase :	List[Any]     ,_UpperCAmelCase :	Any     ,_UpperCAmelCase :	Dict     ,_UpperCAmelCase :	List[str]     ,_UpperCAmelCase :	Any		):
									_a					:				List[str]				=							NystromformerForMaskedLM(config=_UpperCAmelCase		)
									model.to(_UpperCAmelCase		)
									model.eval()
									_a					:				str				=							model(_UpperCAmelCase     ,attention_mask=_UpperCAmelCase     ,token_type_ids=_UpperCAmelCase     ,labels=_UpperCAmelCase		)
									self.parent.assertEqual(result.logits.shape     ,(self.batch_size, self.seq_length, self.vocab_size)		)







							def 							__lowercase      (							self :	Optional[Any]     ,_UpperCAmelCase :	List[str]     ,_UpperCAmelCase :	List[Any]     ,_UpperCAmelCase :	Dict     ,_UpperCAmelCase :	List[str]     ,_UpperCAmelCase :	str     ,_UpperCAmelCase :	int     ,_UpperCAmelCase :	Union[str, Any]		):
									_a					:				Union[str, Any]				=							NystromformerForQuestionAnswering(config=_UpperCAmelCase		)
									model.to(_UpperCAmelCase		)
									model.eval()
									_a					:				Tuple				=							model(
									    _UpperCAmelCase     ,attention_mask=_UpperCAmelCase     ,token_type_ids=_UpperCAmelCase     ,start_positions=_UpperCAmelCase     ,end_positions=_UpperCAmelCase     ,)
									self.parent.assertEqual(result.start_logits.shape     ,(self.batch_size, self.seq_length)		)
									self.parent.assertEqual(result.end_logits.shape     ,(self.batch_size, self.seq_length)		)







							def 							__lowercase      (							self :	Any     ,_UpperCAmelCase :	List[Any]     ,_UpperCAmelCase :	Optional[Any]     ,_UpperCAmelCase :	Tuple     ,_UpperCAmelCase :	List[Any]     ,_UpperCAmelCase :	int     ,_UpperCAmelCase :	Dict     ,_UpperCAmelCase :	Any		):
									_a					:				str				=							self.num_labels
									_a					:				Optional[Any]				=							NystromformerForSequenceClassification(_UpperCAmelCase		)
									model.to(_UpperCAmelCase		)
									model.eval()
									_a					:				Optional[int]				=							model(_UpperCAmelCase     ,attention_mask=_UpperCAmelCase     ,token_type_ids=_UpperCAmelCase     ,labels=_UpperCAmelCase		)
									self.parent.assertEqual(result.logits.shape     ,(self.batch_size, self.num_labels)		)







							def 							__lowercase      (							self :	str     ,_UpperCAmelCase :	Optional[Any]     ,_UpperCAmelCase :	List[Any]     ,_UpperCAmelCase :	str     ,_UpperCAmelCase :	int     ,_UpperCAmelCase :	Optional[int]     ,_UpperCAmelCase :	Any     ,_UpperCAmelCase :	Union[str, Any]		):
									_a					:				Optional[int]				=							self.num_labels
									_a					:				Any				=							NystromformerForTokenClassification(config=_UpperCAmelCase		)
									model.to(_UpperCAmelCase		)
									model.eval()
									_a					:				Tuple				=							model(_UpperCAmelCase     ,attention_mask=_UpperCAmelCase     ,token_type_ids=_UpperCAmelCase     ,labels=_UpperCAmelCase		)
									self.parent.assertEqual(result.logits.shape     ,(self.batch_size, self.seq_length, self.num_labels)		)







							def 							__lowercase      (							self :	Union[str, Any]     ,_UpperCAmelCase :	int     ,_UpperCAmelCase :	Dict     ,_UpperCAmelCase :	Union[str, Any]     ,_UpperCAmelCase :	str     ,_UpperCAmelCase :	Dict     ,_UpperCAmelCase :	Tuple     ,_UpperCAmelCase :	Any		):
									_a					:				int				=							self.num_choices
									_a					:				Optional[Any]				=							NystromformerForMultipleChoice(config=_UpperCAmelCase		)
									model.to(_UpperCAmelCase		)
									model.eval()
									_a					:				Tuple				=							input_ids.unsqueeze(1		).expand(-1     ,self.num_choices     ,-1		).contiguous()
									_a					:				List[Any]				=							token_type_ids.unsqueeze(1		).expand(-1     ,self.num_choices     ,-1		).contiguous()
									_a					:				Any				=							input_mask.unsqueeze(1		).expand(-1     ,self.num_choices     ,-1		).contiguous()
									_a					:				List[str]				=							model(
									    _UpperCAmelCase     ,attention_mask=_UpperCAmelCase     ,token_type_ids=_UpperCAmelCase     ,labels=_UpperCAmelCase     ,)
									self.parent.assertEqual(result.logits.shape     ,(self.batch_size, self.num_choices)		)







							def 							__lowercase      (							self :	Union[str, Any]		):
									_a					:				Optional[Any]				=							self.prepare_config_and_inputs()
									(
									    (
									    _a
									)	, (
									    _a
									)	, (
									    _a
									)	, (
									    _a
									)	, (
									    _a
									)	, (
									    _a
									)	, (
									    _a
									)	, 
									)					:				List[str]				=							config_and_inputs
									_a					:				str				=							{'input_ids': input_ids, 'token_type_ids': token_type_ids, 'attention_mask': input_mask}
									return config, inputs_dict

@require_torch
class      __magic_name__						(   _UpperCamelCase      ,						_UpperCamelCase      ,						unittest.TestCase       ):
							lowerCAmelCase	:   List[Any]           = (
							    (
							        NystromformerModel,
							        NystromformerForMaskedLM,
							        NystromformerForMultipleChoice,
							        NystromformerForQuestionAnswering,
							        NystromformerForSequenceClassification,
							        NystromformerForTokenClassification,
							    )
							    if is_torch_available()
							    else ()
							)
							lowerCAmelCase	:   Optional[Any]           = (
							    {
							        'feature-extraction': NystromformerModel,
							        'fill-mask': NystromformerForMaskedLM,
							        'question-answering': NystromformerForQuestionAnswering,
							        'text-classification': NystromformerForSequenceClassification,
							        'token-classification': NystromformerForTokenClassification,
							        'zero-shot': NystromformerForSequenceClassification,
							    }
							    if is_torch_available()
							    else {}
							)
							lowerCAmelCase	:   List[str]           = False
							lowerCAmelCase	:   int           = False







							def 							__lowercase      (							self :	Optional[Any]		):
									_a					:				Dict				=							NystromformerModelTester(self		)
									_a					:				Dict				=							ConfigTester(self     ,config_class=_UpperCAmelCase     ,hidden_size=37		)







							def 							__lowercase      (							self :	Tuple		):
									self.config_tester.run_common_tests()







							def 							__lowercase      (							self :	List[Any]		):
									_a					:				int				=							self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_model(*_UpperCAmelCase		)







							def 							__lowercase      (							self :	Union[str, Any]		):
									_a					:				int				=							self.model_tester.prepare_config_and_inputs()
									for type in ["absolute", "relative_key", "relative_key_query"]:
											_a					:				List[str]				=							type
											self.model_tester.create_and_check_model(*_UpperCAmelCase		)







							def 							__lowercase      (							self :	Tuple		):
									_a					:				Optional[Any]				=							self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_masked_lm(*_UpperCAmelCase		)







							def 							__lowercase      (							self :	Tuple		):
									_a					:				Any				=							self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_multiple_choice(*_UpperCAmelCase		)







							def 							__lowercase      (							self :	Optional[Any]		):
									_a					:				Any				=							self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_question_answering(*_UpperCAmelCase		)







							def 							__lowercase      (							self :	int		):
									_a					:				Tuple				=							self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_sequence_classification(*_UpperCAmelCase		)







							def 							__lowercase      (							self :	List[Any]		):
									_a					:				int				=							self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_token_classification(*_UpperCAmelCase		)







							@slow
							def 							__lowercase      (							self :	Dict		):
									for model_name in NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
											_a					:				List[Any]				=							NystromformerModel.from_pretrained(_UpperCAmelCase		)
											self.assertIsNotNone(_UpperCAmelCase		)

@require_torch
class      __magic_name__						(   unittest.TestCase       ):







							@slow
							def 							__lowercase      (							self :	Union[str, Any]		):
									_a					:				List[str]				=							NystromformerModel.from_pretrained('uw-madison/nystromformer-512'		)
									_a					:				Optional[Any]				=							torch.tensor([[0, 1, 2, 3, 4, 5]]		)

									with torch.no_grad():
											_a					:				Optional[Any]				=							model(_UpperCAmelCase		)[0]

									_a					:				Optional[Any]				=							torch.Size((1, 6, 768)		)
									self.assertEqual(output.shape     ,_UpperCAmelCase		)

									_a					:				Any				=							torch.tensor(
									    [[[-0.45_32, -0.09_36, 0.51_37], [-0.26_76, 0.06_28, 0.61_86], [-0.36_29, -0.17_26, 0.47_16]]]		)

									self.assertTrue(torch.allclose(output[:, :3, :3]     ,_UpperCAmelCase     ,atol=1E-4		)		)







							@slow
							def 							__lowercase      (							self :	Union[str, Any]		):
									_a					:				Optional[Any]				=							'the [MASK] of Belgium is Brussels'

									_a					:				Union[str, Any]				=							AutoTokenizer.from_pretrained('uw-madison/nystromformer-512'		)
									_a					:				Optional[Any]				=							NystromformerForMaskedLM.from_pretrained('uw-madison/nystromformer-512'		)

									_a					:				List[str]				=							tokenizer(_UpperCAmelCase     ,return_tensors='pt'		)

									with torch.no_grad():
											_a					:				Union[str, Any]				=							model(encoding.input_ids		).logits

									_a					:				Tuple				=							token_logits[:, 2, :].argmax(-1		)[0]

									self.assertEqual(tokenizer.decode(_UpperCAmelCase		)     ,'capital'		)









'''simple docstring'''

from math import sqrt



def 					__lowerCamelCase					(				lowerCAmelCase_  )      ->				int:
		_a					:				Dict				=							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_ = 10000  )      ->				int:
		_a					:				Union[str, Any]				=							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())))




