#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long N, P;
  cin >> N >> P;
  long long answer = 1;
  long long n = 1;
  while (true) {
    long long a = pow(n, N);
    long long b = P / a;
    if (P == a * b) {
      answer = n;
    }
    if (P <= a) {
      break;
    }
    n++;
  }
  cout << answer << endl;
  return 0;
}
