import math n=int(input()) out=n if n%2==0 and n-4:out=n//2 for i in range(3,int(math.sqrt(n))+1): if n%i==0: out=i break print(out)