A, B = int(input()), int(input()) if A == 1: print(5000000000000000) elif A > 1: print(- B // (A - 1)) else: print(B // (1 - A))