n=int(input()) for i in range(3,n+1): if n%i<1: print(i); break