N = input()

div = []
for i in xrange(2, int(N**0.5)+1):
    if N%i == 0:
        div.append(i)
        div.append(N/i)

while 2 in div:
    div.remove(2)
    
if div:
    div.sort()
    if div[0] == 2:
        print div[1]
    else:
        print div[0]
else:
    print N