#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, P;
  cin >> N >> P;
  map<long long, long long> M;
  for (long long i = 2; i * i <= P; i++) {
    while (P % i == 0) {
      M[i]++;
      P /= i;
    }
  }
  if (P > 1LL) M[P]++;
  long long ans = 1;
  for (auto m : M) {
    if (m.second >= N) ans *= m.first * (m.second / N);
  }
  cout << ans << endl;
  return 0;
}
