#include <bits/stdc++.h>
using namespace std;
long long int n, p, g = 1, ma = 1000000000000, r = 1, ra;
vector<long long int> ap = {1};
int main() {
  scanf("%lld %lld", &n, &p);
  if (n == 1)
    r = p;
  else {
    while (ap[ap.size() - 1] <= ma) {
      g++;
      ra = 1;
      for (int i = 0; i < n; i++) ra *= g;
      ap.push_back(ra);
    }
    for (int i = ap.size() - 1; i >= 1; i--) {
      if (p % ap[i] == 0) {
        r = i + 1;
        break;
      }
    }
  }
  printf("%lld\n", r);
}
