import math N = int(input()) ans = N root = int(math.sqrt(N)) for i in range(1, root + 1): if N % i == 0: b = N // i if i % 2 == 1 and i >= 3: ans = min(ans, i) if b % 2 == 1 and b >= 3: ans = min(ans, b) print(ans)