#include <bits/stdc++.h>
using namespace std;
inline bool isprime(long long p) {
  if (p == 1) return false;
  for (long long i = 2; i <= sqrt(p); i++) {
    if (p % i == 0) return false;
  }
  return true;
}
int main() {
  long long N, P;
  cin >> N >> P;
  int ans = 1;
  long long M = P;
  for (long long i = 2; i <= M; i++) {
    long long cnt = 0;
    while (M % i == 0) {
      cnt++;
      M /= i;
    }
    if (cnt >= N) {
      ans *= (cnt / N) * i;
    }
  }
  cout << ans << endl;
  return 0;
}
