a = int(input()) b = int(input()) plus = 2 ** 128 if a == 1: print(plus) else: print(b // (1 - a) + plus)