n,p = map(int,input().split())
a = []
i = 2
while (p>1) and (i < int(p**0.5) + 1):
    c = 0
    while p%i == 0:
        p = p/i
        c += 1
    a.append([i,c])
    i += 1

c = 1
for i in range(len(a)):
  if a[i][1] >= n:
  	c = c* a[i][0] * int(a[i][1]/n)
    
print(c)