"""simple docstring"""






import unittest
from typing import Tuple

import torch

from diffusers.utils import floats_tensor, randn_tensor, torch_all_close, torch_device
from diffusers.utils.testing_utils import require_torch

@require_torch
class lowerCamelCase		:






					'''simple docstring'''


					@property
					def       lowerCAmelCase_       (    self      :					Union[str, Any]		)				->							Dict:
									return self.get_dummy_input()



					@property
					def       lowerCAmelCase_       (    self      :					List[Any]		)				->							List[str]:



									if self.block_type == "down":
													return (4, 32, 16, 16)
									elif self.block_type == "mid":
													return (4, 32, 32, 32)
									elif self.block_type == "up":
													return (4, 32, 64, 64)

									raise ValueError(F"""\'{self.block_type}\' is not a supported block_type. Set it to \'up\', \'mid\', or \'down\'."""		)



					def       lowerCAmelCase_       (    self      :					Union[str, Any] ,			_snake_case      :					Dict=True ,			_snake_case      :					List[Any]=False ,			_snake_case      :					str=False ,			_snake_case      :					Optional[int]=False ,			)				->							List[Any]:
									SCREAMING_SNAKE_CASE__			=					4
									SCREAMING_SNAKE_CASE__			=					32
									SCREAMING_SNAKE_CASE__			=					(32, 32)

									SCREAMING_SNAKE_CASE__			=					torch.manual_seed(0		)
									SCREAMING_SNAKE_CASE__			=					torch.device(lowerCamelCase_		)
									SCREAMING_SNAKE_CASE__			=					(batch_size, num_channels) + sizes
									SCREAMING_SNAKE_CASE__			=					randn_tensor(lowerCamelCase_ ,			generator=lowerCamelCase_ ,			device=lowerCamelCase_		)
									SCREAMING_SNAKE_CASE__			=					{"""hidden_states""": hidden_states}

									if include_temb:
													SCREAMING_SNAKE_CASE__			=					128
													SCREAMING_SNAKE_CASE__			=					randn_tensor((batch_size, temb_channels) ,			generator=lowerCamelCase_ ,			device=lowerCamelCase_		)

									if include_res_hidden_states_tuple:
													SCREAMING_SNAKE_CASE__			=					torch.manual_seed(1		)
													SCREAMING_SNAKE_CASE__			=					(randn_tensor(lowerCamelCase_ ,			generator=lowerCamelCase_ ,			device=lowerCamelCase_		),)

									if include_encoder_hidden_states:
													SCREAMING_SNAKE_CASE__			=					floats_tensor((batch_size, 32, 32)		).to(lowerCamelCase_		)

									if include_skip_sample:
													SCREAMING_SNAKE_CASE__			=					randn_tensor(((batch_size, 3) + sizes) ,			generator=lowerCamelCase_ ,			device=lowerCamelCase_		)

									return dummy_input



					def       lowerCAmelCase_       (    self      :					Optional[Any]		)				->							int:
									SCREAMING_SNAKE_CASE__			=					{
									    """in_channels""": 32,
									    """out_channels""": 32,
									    """temb_channels""": 128,
									}
									if self.block_type == "up":
													SCREAMING_SNAKE_CASE__			=					32

									if self.block_type == "mid":
													init_dict.pop("out_channels"		)

									SCREAMING_SNAKE_CASE__			=					self.dummy_input
									return init_dict, inputs_dict



					def       lowerCAmelCase_       (    self      :					Any ,			_snake_case      :					Any		)				->							Optional[int]:
									SCREAMING_SNAKE_CASE__			=					self.prepare_init_args_and_inputs_for_common()
									SCREAMING_SNAKE_CASE__			=					self.block_class(**lowerCamelCase_		)
									unet_block.to(lowerCamelCase_		)
									unet_block.eval()

									with torch.no_grad():
													SCREAMING_SNAKE_CASE__			=					unet_block(**lowerCamelCase_		)

									if isinstance(lowerCamelCase_ ,			lowerCamelCase_		):
													SCREAMING_SNAKE_CASE__			=					output[0]

									self.assertEqual(output.shape ,			self.output_shape		)

									SCREAMING_SNAKE_CASE__			=					output[0, -1, -3:, -3:]
									SCREAMING_SNAKE_CASE__			=					torch.tensor(lowerCamelCase_		).to(lowerCamelCase_		)
									assert torch_all_close(output_slice.flatten() ,			lowerCamelCase_ ,			atol=5e-3		)



					@unittest.skipIf(torch_device == "mps" ,			"Training is not supported in mps"		)
					def       lowerCAmelCase_       (    self      :					int		)				->							Tuple:
									SCREAMING_SNAKE_CASE__			=					self.prepare_init_args_and_inputs_for_common()
									SCREAMING_SNAKE_CASE__			=					self.block_class(**lowerCamelCase_		)
									model.to(lowerCamelCase_		)
									model.train()
									SCREAMING_SNAKE_CASE__			=					model(**lowerCamelCase_		)

									if isinstance(lowerCamelCase_ ,			lowerCamelCase_		):
													SCREAMING_SNAKE_CASE__			=					output[0]

									SCREAMING_SNAKE_CASE__			=					torch.device(lowerCamelCase_		)
									SCREAMING_SNAKE_CASE__			=					randn_tensor(output.shape ,			device=lowerCamelCase_		)
									SCREAMING_SNAKE_CASE__			=					torch.nn.functional.mse_loss(lowerCamelCase_ ,			lowerCamelCase_		)
									loss.backward()











'''simple docstring'''




from math import sqrt



def 		__A		(  lowerCamelCase_	):


		"""simple docstring"""



		SCREAMING_SNAKE_CASE :				str		=			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 		__A		(  lowerCamelCase_ = 1_00_00	):


		"""simple docstring"""



		SCREAMING_SNAKE_CASE :				str		=			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())))



