# -*- coding: utf-8 -*- N = int(input()) i = 2 is_prime = True while i*i<=N: if N%i == 0: is_prime = False break i += 1 if is_prime: print(N) else: if i == 2: print(N//2) else: print(i)