import sys def input(): return sys.stdin.readline().rstrip('\n') def main(): n = int(input()) i = 3 while i*i <= n: if n % i == 0: print(i) return i += 1 print(n) if __name__ == '__main__': main()