



'''simple docstring'''

import torch

from diffusers import DDIMParallelScheduler

from .test_schedulers import SchedulerCommonTest

class      __magic_name__						(   _UpperCamelCase       ):
							lowerCAmelCase	:   str           = (DDIMParallelScheduler,)
							lowerCAmelCase	:   List[Any]           = (('eta', 0.0), ('num_inference_steps', 5_0))







							def 							__lowercase      (							self :	Tuple     ,**_UpperCAmelCase :	Union[str, Any]		):
									_a					:				Union[str, Any]				=							{
									    'num_train_timesteps': 1000,
									    'beta_start': 0.00_01,
									    'beta_end': 0.02,
									    'beta_schedule': 'linear',
									    'clip_sample': True,
									}

									config.update(**_UpperCAmelCase		)
									return config







							def 							__lowercase      (							self :	Dict     ,**_UpperCAmelCase :	Optional[int]		):
									_a					:				List[str]				=							self.scheduler_classes[0]
									_a					:				Optional[int]				=							self.get_scheduler_config(**_UpperCAmelCase		)
									_a					:				List[str]				=							scheduler_class(**_UpperCAmelCase		)

									_a	, _a					:				Optional[int]				=							10, 0.0

									_a					:				Optional[Any]				=							self.dummy_model()
									_a					:				Dict				=							self.dummy_sample_deter

									scheduler.set_timesteps(_UpperCAmelCase		)

									for t in scheduler.timesteps:
											_a					:				Union[str, Any]				=							model(_UpperCAmelCase     ,_UpperCAmelCase		)
											_a					:				int				=							scheduler.step(_UpperCAmelCase     ,_UpperCAmelCase     ,_UpperCAmelCase     ,_UpperCAmelCase		).prev_sample

									return sample







							def 							__lowercase      (							self :	Dict		):
									for timesteps in [100, 500, 1000]:
											self.check_over_configs(num_train_timesteps=_UpperCAmelCase		)







							def 							__lowercase      (							self :	Optional[Any]		):
									for steps_offset in [0, 1]:
											self.check_over_configs(steps_offset=_UpperCAmelCase		)

									_a					:				List[str]				=							self.scheduler_classes[0]
									_a					:				Optional[int]				=							self.get_scheduler_config(steps_offset=1		)
									_a					:				Dict				=							scheduler_class(**_UpperCAmelCase		)
									scheduler.set_timesteps(5		)
									assert torch.equal(scheduler.timesteps     ,torch.LongTensor([801, 601, 401, 201, 1]		)		)







							def 							__lowercase      (							self :	Any		):
									for beta_start, beta_end in zip([0.00_01, 0.0_01, 0.01, 0.1]     ,[0.0_02, 0.02, 0.2, 2]		):
											self.check_over_configs(beta_start=_UpperCAmelCase     ,beta_end=_UpperCAmelCase		)







							def 							__lowercase      (							self :	int		):
									for schedule in ["linear", "squaredcos_cap_v2"]:
											self.check_over_configs(beta_schedule=_UpperCAmelCase		)







							def 							__lowercase      (							self :	Tuple		):
									for prediction_type in ["epsilon", "v_prediction"]:
											self.check_over_configs(prediction_type=_UpperCAmelCase		)







							def 							__lowercase      (							self :	Optional[int]		):
									for clip_sample in [True, False]:
											self.check_over_configs(clip_sample=_UpperCAmelCase		)







							def 							__lowercase      (							self :	int		):
									for timestep_spacing in ["trailing", "leading"]:
											self.check_over_configs(timestep_spacing=_UpperCAmelCase		)







							def 							__lowercase      (							self :	Optional[Any]		):
									for rescale_betas_zero_snr in [True, False]:
											self.check_over_configs(rescale_betas_zero_snr=_UpperCAmelCase		)







							def 							__lowercase      (							self :	Union[str, Any]		):
									self.check_over_configs(thresholding=_UpperCAmelCase		)
									for threshold in [0.5, 1.0, 2.0]:
											for prediction_type in ["epsilon", "v_prediction"]:
													self.check_over_configs(
													    thresholding=_UpperCAmelCase     ,prediction_type=_UpperCAmelCase     ,sample_max_value=_UpperCAmelCase     ,)







							def 							__lowercase      (							self :	Tuple		):
									for t in [1, 10, 49]:
											self.check_over_forward(time_step=_UpperCAmelCase		)







							def 							__lowercase      (							self :	Union[str, Any]		):
									for t, num_inference_steps in zip([1, 10, 50]     ,[10, 50, 500]		):
											self.check_over_forward(time_step=_UpperCAmelCase     ,num_inference_steps=_UpperCAmelCase		)







							def 							__lowercase      (							self :	Union[str, Any]		):
									for t, eta in zip([1, 10, 49]     ,[0.0, 0.5, 1.0]		):
											self.check_over_forward(time_step=_UpperCAmelCase     ,eta=_UpperCAmelCase		)







							def 							__lowercase      (							self :	Union[str, Any]		):
									_a					:				List[str]				=							self.scheduler_classes[0]
									_a					:				List[str]				=							self.get_scheduler_config()
									_a					:				Optional[int]				=							scheduler_class(**_UpperCAmelCase		)

									assert torch.sum(torch.abs(scheduler._get_variance(0     ,0		) - 0.0		)		) < 1E-5
									assert torch.sum(torch.abs(scheduler._get_variance(420     ,400		) - 0.1_47_71		)		) < 1E-5
									assert torch.sum(torch.abs(scheduler._get_variance(980     ,960		) - 0.3_24_60		)		) < 1E-5
									assert torch.sum(torch.abs(scheduler._get_variance(0     ,0		) - 0.0		)		) < 1E-5
									assert torch.sum(torch.abs(scheduler._get_variance(487     ,486		) - 0.0_09_79		)		) < 1E-5
									assert torch.sum(torch.abs(scheduler._get_variance(999     ,998		) - 0.02		)		) < 1E-5







							def 							__lowercase      (							self :	Tuple		):
									_a					:				Union[str, Any]				=							self.scheduler_classes[0]
									_a					:				Tuple				=							self.get_scheduler_config()
									_a					:				Any				=							scheduler_class(**_UpperCAmelCase		)

									_a	, _a					:				List[Any]				=							10, 0.0
									scheduler.set_timesteps(_UpperCAmelCase		)

									_a					:				Dict				=							self.dummy_model()
									_a					:				Any				=							self.dummy_sample_deter
									_a					:				Any				=							self.dummy_sample_deter + 0.1
									_a					:				str				=							self.dummy_sample_deter - 0.1

									_a					:				Dict				=							samplea.shape[0]
									_a					:				Optional[int]				=							torch.stack([samplea, samplea, samplea]     ,dim=0		)
									_a					:				List[str]				=							torch.arange(_UpperCAmelCase		)[0:3, None].repeat(1     ,_UpperCAmelCase		)

									_a					:				List[Any]				=							model(samples.flatten(0     ,1		)     ,timesteps.flatten(0     ,1		)		)
									_a					:				Optional[Any]				=							scheduler.batch_step_no_noise(_UpperCAmelCase     ,timesteps.flatten(0     ,1		)     ,samples.flatten(0     ,1		)     ,_UpperCAmelCase		)

									_a					:				Optional[Any]				=							torch.sum(torch.abs(_UpperCAmelCase		)		)
									_a					:				Tuple				=							torch.mean(torch.abs(_UpperCAmelCase		)		)

									assert abs(result_sum.item() - 11_47.79_04		) < 1E-2
									assert abs(result_mean.item() - 0.49_82		) < 1E-3







							def 							__lowercase      (							self :	Any		):
									_a					:				Any				=							self.full_loop()

									_a					:				List[str]				=							torch.sum(torch.abs(_UpperCAmelCase		)		)
									_a					:				Optional[int]				=							torch.mean(torch.abs(_UpperCAmelCase		)		)

									assert abs(result_sum.item() - 1_72.00_67		) < 1E-2
									assert abs(result_mean.item() - 0.22_39_67		) < 1E-3







							def 							__lowercase      (							self :	str		):
									_a					:				Optional[Any]				=							self.full_loop(prediction_type='v_prediction'		)

									_a					:				List[Any]				=							torch.sum(torch.abs(_UpperCAmelCase		)		)
									_a					:				Union[str, Any]				=							torch.mean(torch.abs(_UpperCAmelCase		)		)

									assert abs(result_sum.item() - 52.53_02		) < 1E-2
									assert abs(result_mean.item() - 0.06_84		) < 1E-3







							def 							__lowercase      (							self :	Dict		):
									# We specify different beta, so that the first alpha is 0.99
									_a					:				Tuple				=							self.full_loop(set_alpha_to_one=_UpperCAmelCase     ,beta_start=0.01		)
									_a					:				int				=							torch.sum(torch.abs(_UpperCAmelCase		)		)
									_a					:				Any				=							torch.mean(torch.abs(_UpperCAmelCase		)		)

									assert abs(result_sum.item() - 1_49.82_95		) < 1E-2
									assert abs(result_mean.item() - 0.19_51		) < 1E-3







							def 							__lowercase      (							self :	Tuple		):
									# We specify different beta, so that the first alpha is 0.99
									_a					:				int				=							self.full_loop(set_alpha_to_one=_UpperCAmelCase     ,beta_start=0.01		)
									_a					:				Any				=							torch.sum(torch.abs(_UpperCAmelCase		)		)
									_a					:				List[str]				=							torch.mean(torch.abs(_UpperCAmelCase		)		)

									assert abs(result_sum.item() - 1_49.07_84		) < 1E-2
									assert abs(result_mean.item() - 0.19_41		) < 1E-3









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




