n=int(input()) i=3 while 1: if n % i==0: print(i) break i+=1