#約数全部 def Divisors(N): N=abs(N) L,U=[],[] k=1 while k*k <=N: if N%k== 0: L.append(k) if k!=N//k: U.append(N//k) k+=1 return L+U[::-1] #================================================ N=int(input()) R=Divisors(N) for a in R: if a>=3: print(a) exit()