#include <bits/stdc++.h>
using namespace std;
int main()
{
	freopen("bai1_16.inp", "r", stdin);
	freopen("bai1_16.out", "w", stdout);
 	int n;
 	int snt[50], top=0;
 	cin>>n;
 	int k=2;
 	while(n!=1)
	{
 		if(n%k==0)
		{
 			snt[top]=k;
 			top++;
		}
 		while(n%k==0)
		{
 			n/=k;
		}
		if(k*k>n)
		{
			snt[top]=n;
			top++;
			break;
		}
		k++;
	}
	cout<<snt[top-1];
}

