from sys import stdin, stdout from decimal import Decimal as d def dec_range(x,y): x= d(x) y= d(y) while x < y: yield x x= x+1 def f(n): n= d(n) for y in dec_range(d(3),n): if n%y == d(0): return y return n n= stdin.readline() print f(n)