n = int(input()) p = 2 pmax = int(n**0.5) num_list = [] while p <= pmax: if n % p == 0: while n % p == 0: n //= p num_list.append(p) p += 1 if n != 1: num_list.append(n) if num_list[0] > 2: print(num_list[0]) elif num_list[0] == 2: if num_list[1] == 2: if 3 in num_list: print(3) else: print(4) else: print(num_list[1])