#include <fstream>
#include <cmath>

using namespace std;

ifstream input("Bai1_16.inp");
ofstream output("Bai1_16.out");

int main()
{
	long long n, index = 2, res;
	input >> n;
	while (n % 2 == 0)
	{
		res = 2;
		n >>= 1;
	}
	for (long long i = 3; i <= sqrt(n); i += 2)
	{
		while (n % i == 0)
		{
			res = i;
			n /= i;
		}
	}
	if (n > 2)
	{
		res = n;
	}
	output << res;
	input.close();
	output.close();
	return 0;
}