N, K = list(map(int, input().split())) cnt = 0 num = 1 while True: if num * (2**K) <= 2**N: cnt += 1 num += 1 else: break print(cnt)