eolymp
bolt
Try our new interface for solving problems
Problems

Maximize the Ratio

Maximize the Ratio

Consider the function R(x) of positive integer x as R(x) = x / S(x), where S(x) is the sum of all divisors of x. For example, R(6) = 6 / (1 + 2 + 3 + 6) = 0.5, R(7) = 7 / (1 + 7) = 0.875 . Given n, find an integer xn such that R(X) is maximal. If there is more than one such integer, choose the maximal one.

Input

One integer n (1n105).

Output

Print one integer x: the answer to the problem.

Time limit 1 second
Memory limit 128 MiB
Input example #1
9
Output example #1
1
Source 2019 ACM ICPC 1/4 Azerbaijan