N = int(input()) A = set() for i in range(1,N+1): if i*i>N: break if N%i==0: A.add(i) A.add(N//i) A = sorted(list(A)) for a in A: if a not in [1,2]: print(a) break