





import os
from shutil import copyfile
from typing import Any, Dict, List, Optional, Tuple

import sentencepiece as spm

from ...tokenization_utils import PreTrainedTokenizer
from ...utils import logging


UpperCAmelCase__						:			Union[str, Any]									=logging.get_logger(__name__)

UpperCAmelCase__						:			Any									='''▁'''

UpperCAmelCase__						:			Optional[int]									={'''vocab_file''': '''sentencepiece.bpe.model'''}

UpperCAmelCase__						:			str									={
    '''vocab_file''': {
        '''facebook/xglm-564M''': '''https://huggingface.co/facebook/xglm-564M/resolve/main/sentencepiece.bpe.model''',
    }
}

UpperCAmelCase__						:			List[Any]									={
    '''facebook/xglm-564M''': 20_48,
}

class       __A     (						a    ):
				__A      =				VOCAB_FILES_NAMES
				__A      =				PRETRAINED_VOCAB_FILES_MAP
				__A      =				PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
				__A      =				["""input_ids""", """attention_mask"""]


				def __init__(		self   , UpperCAmelCase_   , UpperCAmelCase_="<s>"   , UpperCAmelCase_="</s>"   , UpperCAmelCase_="</s>"   , UpperCAmelCase_="<s>"   , UpperCAmelCase_="<unk>"   , UpperCAmelCase_="<pad>"   , UpperCAmelCase_ = None   , **UpperCAmelCase_   , ):
								lowerCamelCase	 ={} if sp_model_kwargs is None else sp_model_kwargs

								# Compatibility with the original tokenizer
								lowerCamelCase	 =7
								lowerCamelCase	 =[f"""<madeupword{i}>""" for i in range(self.num_madeup_words							)]

								lowerCamelCase	 =kwargs.get("""additional_special_tokens"""   , []							)
								kwargs["additional_special_tokens"] += [
								    word for word in madeup_words if word not in kwargs["additional_special_tokens"]
								]

								super().__init__(
								    bos_token=UpperCAmelCase_   , eos_token=UpperCAmelCase_   , unk_token=UpperCAmelCase_   , sep_token=UpperCAmelCase_   , cls_token=UpperCAmelCase_   , pad_token=UpperCAmelCase_   , sp_model_kwargs=self.sp_model_kwargs   , **UpperCAmelCase_   , )

								lowerCamelCase	 =spm.SentencePieceProcessor(**self.sp_model_kwargs							)
								self.sp_model.Load(str(UpperCAmelCase_							)							)
								lowerCamelCase	 =vocab_file

								# Original fairseq vocab and spm vocab must be "aligned":
								# Vocab    |    0    |    1    |   2    |    3    |  4  |  5  |  6  |   7   |   8   |  9
								# -------- | ------- | ------- | ------ | ------- | --- | --- | --- | ----- | ----- | ----
								# fairseq  | '<s>'   | '<pad>' | '</s>' | '<unk>' | ',' | '.' | '▁' | 's'   | '▁de' | '-'
								# spm      | '<unk>' | '<s>'   | '</s>' | ','     | '.' | '▁' | 's' | '▁de' | '-'   | '▁a'

								# The first "real" token "," has position 4 in the original fairseq vocab and position 3 in the spm vocab
								lowerCamelCase	 =1

								# Mimic fairseq token-to-id alignment for the first 4 token
								lowerCamelCase	 ={"""<s>""": 0, """<pad>""": 1, """</s>""": 2, """<unk>""": 3}

								lowerCamelCase	 =len(self.sp_model							)
								lowerCamelCase	 ={f"""<madeupword{i}>""": sp_size + i + self.fairseq_offset for i in range(self.num_madeup_words							)}
								self.fairseq_tokens_to_ids.update(UpperCAmelCase_							)

								lowerCamelCase	 ={v: k for k, v in self.fairseq_tokens_to_ids.items()}


				def __getstate__(		self							):
								lowerCamelCase	 =self.__dict__.copy()
								lowerCamelCase	 =None
								lowerCamelCase	 =self.sp_model.serialized_model_proto()
								return state


				def __setstate__(		self   , UpperCAmelCase_							):
								lowerCamelCase	 =d

								# for backward compatibility
								if not hasattr(self   , """sp_model_kwargs"""							):
												lowerCamelCase	 ={}

								lowerCamelCase	 =spm.SentencePieceProcessor(**self.sp_model_kwargs							)
								self.sp_model.LoadFromSerializedProto(self.sp_model_proto							)


				def _snake_case       (		self   , UpperCAmelCase_   , UpperCAmelCase_ = None							):

								if token_ids_a is None:
												return [self.sep_token_id] + token_ids_a
								lowerCamelCase	 =[self.sep_token_id]
								return sep + token_ids_a + sep + sep + token_ids_a


				def _snake_case       (		self   , UpperCAmelCase_   , UpperCAmelCase_ = None   , UpperCAmelCase_ = False							):

								if already_has_special_tokens:
												return super().get_special_tokens_mask(
												    token_ids_a=UpperCAmelCase_   , token_ids_a=UpperCAmelCase_   , already_has_special_tokens=UpperCAmelCase_							)

								if token_ids_a is None:
												return [1] + ([0] * len(UpperCAmelCase_							))
								return [1] + ([0] * len(UpperCAmelCase_							)) + [1, 1] + ([0] * len(UpperCAmelCase_							))


				def _snake_case       (		self   , UpperCAmelCase_   , UpperCAmelCase_ = None							):
								lowerCamelCase	 =[self.sep_token_id]

								if token_ids_a is None:
												return len(sep + token_ids_a							) * [0]
								return len(sep + token_ids_a + sep + sep + token_ids_a							) * [0]


				@property
				def _snake_case       (		self							):
								return len(self.sp_model							) + self.fairseq_offset + self.num_madeup_words


				def _snake_case       (		self							):
								lowerCamelCase	 ={self.convert_ids_to_tokens(UpperCAmelCase_							): i for i in range(self.vocab_size							)}
								vocab.update(self.added_tokens_encoder							)
								return vocab


				def _snake_case       (		self   , UpperCAmelCase_							):
								return self.sp_model.encode(UpperCAmelCase_   , out_type=UpperCAmelCase_							)


				def _snake_case       (		self   , UpperCAmelCase_							):
								if token in self.fairseq_tokens_to_ids:
												return self.fairseq_tokens_to_ids[token]
								lowerCamelCase	 =self.sp_model.PieceToId(UpperCAmelCase_							)

								# Need to return unknown token if the SP model returned 0
								return spm_id + self.fairseq_offset if spm_id else self.unk_token_id


				def _snake_case       (		self   , UpperCAmelCase_							):
								if index in self.fairseq_ids_to_tokens:
												return self.fairseq_ids_to_tokens[index]
								return self.sp_model.IdToPiece(index - self.fairseq_offset							)


				def _snake_case       (		self   , UpperCAmelCase_							):
								lowerCamelCase	 ="""""".join(UpperCAmelCase_							).replace(UpperCAmelCase_   , """ """							).strip()
								return out_string


				def _snake_case       (		self   , UpperCAmelCase_   , UpperCAmelCase_ = None							):
								if not os.path.isdir(UpperCAmelCase_							):
												logger.error(f"""Vocabulary path ({save_directory}) should be a directory"""							)
												return
								lowerCamelCase	 =os.path.join(
								    UpperCAmelCase_   , (filename_prefix + """-""" if filename_prefix else """""") + VOCAB_FILES_NAMES["""vocab_file"""]							)

								if os.path.abspath(self.vocab_file							) != os.path.abspath(UpperCAmelCase_							) and os.path.isfile(self.vocab_file							):
												copyfile(self.vocab_file   , UpperCAmelCase_							)
								elif not os.path.isfile(self.vocab_file							):
												with open(UpperCAmelCase_   , """wb"""							) as fi:
																lowerCamelCase	 =self.sp_model.serialized_model_proto()
																fi.write(UpperCAmelCase_							)

								return (out_vocab_file,)












from math import sqrt





def      _lowercase					(						_UpperCAmelCase				)						->  int:
				lowerCamelCase	 =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      _lowercase					(						_UpperCAmelCase = 1_00_00				)						->  int:
				lowerCamelCase	 =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())))





