n = int(input()) i = 3 while n > i * i: if n % i == 0: break i += 1 if n < i * i: i = n if i % 2 == 0: i /= 2 if n == 4: i = 4 print(i)