import math N = int(input()) for i in range(2, N): c = 0 if i%2==0 and i != 2: continue for divisor in range(2, math.floor(math.sqrt(i))+1): if i % divisor == 0: c = 1 break if c == 0 and N % i == 0 and i != 2: print(i) break