


import argparse

import torch

from transformers import BlenderbotConfig, BlenderbotForConditionalGeneration
from transformers.utils import logging


logging.set_verbosity_info()
UpperCAmelCase__						:			Optional[int]									=logging.get_logger(__name__)

UpperCAmelCase__						:			Optional[Any]									=[
    ['''attention''', '''attn'''],
    ['''encoder_attention''', '''encoder_attn'''],
    ['''q_lin''', '''q_proj'''],
    ['''k_lin''', '''k_proj'''],
    ['''v_lin''', '''v_proj'''],
    ['''out_lin''', '''out_proj'''],
    ['''norm_embeddings''', '''layernorm_embedding'''],
    ['''position_embeddings''', '''embed_positions'''],
    ['''embeddings''', '''embed_tokens'''],
    ['''ffn.lin''', '''fc'''],
]





def      _lowercase					(						_UpperCAmelCase				)						->  int:
				if k == "embeddings.weight":
								return "shared.weight"

				for parlai_name, hf_name in PATTERNS:
								lowerCamelCase	 =k.replace(_UpperCAmelCase			,      _UpperCAmelCase				)

				if k.startswith("""encoder"""				):
								lowerCamelCase	 =k.replace(""".attn"""			,      """.self_attn"""				)
								lowerCamelCase	 =k.replace("""norm1"""			,      """self_attn_layer_norm"""				)
								lowerCamelCase	 =k.replace("""norm2"""			,      """final_layer_norm"""				)
				elif k.startswith("""decoder"""				):
								lowerCamelCase	 =k.replace("""norm1"""			,      """self_attn_layer_norm"""				)
								lowerCamelCase	 =k.replace("""norm2"""			,      """encoder_attn_layer_norm"""				)
								lowerCamelCase	 =k.replace("""norm3"""			,      """final_layer_norm"""				)
				return k





def      _lowercase					(						_UpperCAmelCase				)						->  Optional[Any]:
				lowerCamelCase	 =[
				    """model.encoder.layernorm_embedding.weight""",
				    """model.encoder.layernorm_embedding.bias""",
				    """model.decoder.layernorm_embedding.weight""",
				    """model.decoder.layernorm_embedding.bias""",
				]
				for k in keys:
								lowerCamelCase	 =sd.pop(_UpperCAmelCase				)
								lowerCamelCase	 =k.replace("""layernorm_embedding"""			,      """layer_norm"""				)
								assert new_k not in sd
								lowerCamelCase	 =v


UpperCAmelCase__						:			int									=['''START''']





@torch.no_grad()
def      _lowercase					(						_UpperCAmelCase			,      _UpperCAmelCase			,      _UpperCAmelCase				)						->  Any:
				lowerCamelCase	 =torch.load(_UpperCAmelCase			,      map_location="""cpu"""				)
				lowerCamelCase	 =model["""model"""]
				lowerCamelCase	 =BlenderbotConfig.from_json_file(_UpperCAmelCase				)
				lowerCamelCase	 =BlenderbotForConditionalGeneration(_UpperCAmelCase				)
				lowerCamelCase	 =m.model.state_dict().keys()
				lowerCamelCase	 =[]
				lowerCamelCase	 ={}
				for k, v in sd.items():
								if k in IGNORE_KEYS:
												continue

								lowerCamelCase	 =rename_state_dict_key(_UpperCAmelCase				)
								if new_k not in valid_keys:
												failures.append([k, new_k]				)
								else:
												lowerCamelCase	 =v
				if cfg.normalize_before:  # Blenderbot-3B checkpoints. Rename layernorm_embedding -> layer_norm
								rename_layernorm_keys(_UpperCAmelCase				)
				m.model.load_state_dict(_UpperCAmelCase			,      strict=_UpperCAmelCase				)
				m.half()
				m.save_pretrained(_UpperCAmelCase				)


if __name__ == "__main__":
							UpperCAmelCase__						:			Union[str, Any]									=argparse.ArgumentParser()
							# Required parameters
							parser.add_argument('''--src_path''', type=str, help='''like blenderbot-model.bin''')
							parser.add_argument('''--save_dir''', default='''hf_blenderbot''', type=str, help='''Where to save converted model.''')
							parser.add_argument(
							    '''--hf_config_json''', default='''blenderbot-3b-config.json''', type=str, help='''Path to config to use'''
							)
							UpperCAmelCase__						:			List[str]									=parser.parse_args()
							convert_parlai_checkpoint(args.src_path, args.save_dir, args.hf_config_json)












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())))





