# coding: utf-8 # Here your code ! nNum=input() for i in range(3,nNum): if nNum%i==0: print(i) break