



from math import sqrt





def 							A     (					_UpperCAmelCase    :       int   )    ->			int:







			'''simple docstring'''
			_UpperCAmelCase			=       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 							A     (					_UpperCAmelCase    :       int = 10_000   )    ->			int:







			'''simple docstring'''
			_UpperCAmelCase			=       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())))





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


UpperCAmelCase__       =	{
    "configuration_mega": ["MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP", "MegaConfig", "MegaOnnxConfig"],
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCAmelCase__       =	[
							    "MEGA_PRETRAINED_MODEL_ARCHIVE_LIST",
							    "MegaForCausalLM",
							    "MegaForMaskedLM",
							    "MegaForMultipleChoice",
							    "MegaForQuestionAnswering",
							    "MegaForSequenceClassification",
							    "MegaForTokenClassification",
							    "MegaModel",
							    "MegaPreTrainedModel",
							]

if TYPE_CHECKING:
							from .configuration_mega import MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP, MegaConfig, MegaOnnxConfig

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_mega import (
														    MEGA_PRETRAINED_MODEL_ARCHIVE_LIST,
														    MegaForCausalLM,
														    MegaForMaskedLM,
														    MegaForMultipleChoice,
														    MegaForQuestionAnswering,
														    MegaForSequenceClassification,
														    MegaForTokenClassification,
														    MegaModel,
														    MegaPreTrainedModel,
														)

else:
							import sys

							UpperCAmelCase__       =	_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
