x = 0 n,k = (int(y) for y in input().split(' ')) a = 2**n while a > 0: if a % (2**k) == 0: x += 1 else: x = x a = a -1 print(x)