N,M=map(int,input().split()) for x in range(100): if N**x<=M