#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; long long MOD = 1000000007; long long A[1000000] = {0}; int main() { long long X; cin >> X; for ( long long i = 2; i*i <= X; i++ ) { int j = 0; while ( X%i == 0 ) { X /= i; j++; } A[i] = j; if ( X == 1 ) { break; } } if ( X != 1 ) { cout << X << endl; return 0; } long long ans = 1; for ( long long i = 2; i <= 1000000; i++ ) { if ( A[i]%2 ) { ans *= i; } } cout << ans << endl; return 0; }