
'''simple docstring'''
from __future__ import annotations

__lowerCAmelCase												=	list[tuple[int, int]]

__lowerCAmelCase												=	[
    [0, 0, 0, 0, 0, 0, 0],
    [0, 1, 0, 0, 0, 0, 0],  # 0 are free path whereas 1's are obstacles
    [0, 0, 0, 0, 0, 0, 0],
    [0, 0, 1, 0, 0, 0, 0],
    [1, 0, 1, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 1, 0, 0],
]

__lowerCAmelCase												=	([-1, 0], [0, -1], [1, 0], [0, 1])  # up, left, down, right


class       _lowerCAmelCase   :







							'''simple docstring'''

							def __init__(self  ,  UpperCAmelCase  ,  UpperCAmelCase  ,  UpperCAmelCase  ,  UpperCAmelCase  ,  UpperCAmelCase  ,  UpperCAmelCase  ,  )					->       str:
														_snake_case       =  pos_x
														_snake_case       =  pos_y
														_snake_case       =  (pos_y, pos_x)
														_snake_case       =  goal_x
														_snake_case       =  goal_y
														_snake_case       =  g_cost
														_snake_case       =  parent
														_snake_case       =  self.calculate_heuristic()

							def 	lowercase							(self  )					->       float:
														_snake_case       =  abs(self.pos_x - self.goal_x  )
														_snake_case       =  abs(self.pos_y - self.goal_y  )
														return dx + dy





							def __lt__(self  ,  UpperCAmelCase  )					->       bool:
														return self.f_cost < other.f_cost


class       _lowerCAmelCase   :







							'''simple docstring'''

							def __init__(self  ,  UpperCAmelCase  ,  UpperCAmelCase  )					->       str:
														_snake_case       =  Node(start[1]  ,  start[0]  ,  goal[1]  ,  goal[0]  ,  0  ,  UpperCAmelCase  )
														_snake_case       =  Node(goal[1]  ,  goal[0]  ,  goal[1]  ,  goal[0]  ,  99999  ,  UpperCAmelCase  )

														_snake_case       =  [self.start]
														_snake_case       =  []

														_snake_case       =  False

							def 	lowercase							(self  )					->       Path | None:
														while self.open_nodes:
																					# Open Nodes are sorted using __lt__
																					self.open_nodes.sort()
																					_snake_case       =  self.open_nodes.pop(0  )

																					if current_node.pos == self.target.pos:
																												_snake_case       =  True
																												return self.retrace_path(UpperCAmelCase  )

																					self.closed_nodes.append(UpperCAmelCase  )
																					_snake_case       =  self.get_successors(UpperCAmelCase  )

																					for child_node in successors:
																												if child_node in self.closed_nodes:
																																			continue

																												if child_node not in self.open_nodes:
																																			self.open_nodes.append(UpperCAmelCase  )
																												else:
																																			# retrieve the best current path
																																			_snake_case       =  self.open_nodes.pop(self.open_nodes.index(UpperCAmelCase  )  )

																																			if child_node.g_cost < better_node.g_cost:
																																										self.open_nodes.append(UpperCAmelCase  )
																																			else:
																																										self.open_nodes.append(UpperCAmelCase  )

														if not self.reached:
																					return [self.start.pos]
														return None

							def 	lowercase							(self  ,  UpperCAmelCase  )					->       list[Node]:
														_snake_case       =  []
														for action in delta:
																					_snake_case       =  parent.pos_x + action[1]
																					_snake_case       =  parent.pos_y + action[0]

																					if not (0 <= pos_x <= len(grid[0]  ) - 1 and 0 <= pos_y <= len(UpperCAmelCase  ) - 1):
																												continue

																					if grid[pos_y][pos_x] != 0:
																												continue

																					successors.append(
																					    Node(
																					        UpperCAmelCase  ,  UpperCAmelCase  ,  self.target.pos_y  ,  self.target.pos_x  ,  parent.g_cost + 1  ,  UpperCAmelCase  ,  )  )
														return successors





							def 	lowercase							(self  ,  UpperCAmelCase  )					->       Path:
														_snake_case       =  node
														_snake_case       =  []
														while current_node is not None:
																					path.append((current_node.pos_y, current_node.pos_x)  )
																					_snake_case       =  current_node.parent
														path.reverse()
														return path


if __name__ == "__main__":
				__lowerCAmelCase												=	(0, 0)
				__lowerCAmelCase												=	(len(grid) - 1, len(grid[0]) - 1)
				for elem in grid:
								print(elem)

				print('------')

				__lowerCAmelCase												=	GreedyBestFirst(init, goal)
				__lowerCAmelCase												=	greedy_bf.search()
				if path:
								for pos_x, pos_y in path:
												__lowerCAmelCase												=	2

								for elem in grid:
												print(elem)

'''simple docstring'''
from math import sqrt






def  __SCREAMING_SNAKE_CASE				(  _SCREAMING_SNAKE_CASE				):
							_snake_case       =  0
							for i in range(1							, int(sqrt(_SCREAMING_SNAKE_CASE				) + 1				)				):
														if n % i == 0 and i != sqrt(_SCREAMING_SNAKE_CASE				):
																					total += i + n // i
														elif i == sqrt(_SCREAMING_SNAKE_CASE				):
																					total += i
							return total - n






def  __SCREAMING_SNAKE_CASE				(  _SCREAMING_SNAKE_CASE = 1_0000				):
							_snake_case       =  sum(
							    i
							    for i in range(1							, _SCREAMING_SNAKE_CASE				)
							    if sum_of_divisors(sum_of_divisors(_SCREAMING_SNAKE_CASE				)				) == i and sum_of_divisors(_SCREAMING_SNAKE_CASE				) != i				)
							return total


if __name__ == "__main__":
				print(solution(int(str(input()).strip())))