import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np N = int(read()) x = np.arange(1,10**6 + 10) div = x[N%x == 0] div = np.union1d(div, N//div) div = div[div >= 3] answer = div[0] print(answer)