#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n, p;
  cin >> n >> p;
  long long max, tmp_max;
  for (long long i = 2;; ++i) {
    tmp_max = (long long)pow(i, n);
    if (tmp_max < p) {
      max = i;
    } else
      break;
  }
  vector<pair<long long, long long> > factor(max);
  for (long long i = 2; i <= max; ++i) {
    long long count = 0;
    while ((p % i) == 0) {
      ++count;
      p /= i;
    }
    if (count != 0) {
      factor.push_back(make_pair(i, count));
    }
  }
  long long ret = 1;
  for (vector<pair<long long, long long> >::iterator itr = factor.begin();
       itr != factor.end(); ++itr) {
    if (((*itr).second / n) >= 1) {
      ret *= (long long)(((*itr).second / n) * (*itr).first);
    }
  }
  cout << ret << endl;
  return 0;
}
