#!/usr/bin/python from collections import defaultdict def divisors(n): sq = int(n ** .5) res = [(i, n/i) for i in xrange(1, sq+1) if n%i==0] return res n = int(raw_input()) arr = filter(lambda (x, y): x>2, divisors(n)) or [(n, 1)] res = arr[0][0] print res