a=int(input()) b=int(input()) if a-1>0 and b%(a-1)==0: print(-b//(a-1)) else: print(0)