import Debug.Trace

main = do
    [n,p] <- map read . words <$> getLine :: IO [Int]
    let candMax =  ceiling $ (fromIntegral p) ** (1 / (fromIntegral n))
    print $ solve p n candMax

solve :: Int -> Int -> Int -> Int
solve p n i 
    | i == 1 = 1 
    | isAns = i
    | otherwise = solve p n (i-1)
    where  
        isAns = avoidOverFlow p n i n

avoidOverFlow :: Int -> Int -> Int -> Int -> Bool
avoidOverFlow p n i k
    | k == 0 = True
    | amari /= 0 = False
    | amari == 0 = avoidOverFlow shou n i (k-1)
    where 
        amari = p `mod` i
        shou = p `div` i