def is_prime(n): ans = [] m = int(n ** 0.5) if m == n / m: ans.append(m) for i in range(1, m+1): if n % i == 0: ans.append(i) ans.append(n // i) ans.sort() return ans n = int(input()) for i in is_prime(n): if i == 1 or i == 2: continue else: print(i) break