n,k=map(int,input().split());a=[] n,k=2**n,2**k for i in range(1,n+1): if not i%k: a.append(i) print(len(a))