n,l=map(int,input().split()) n=(n+l-1)//l ans=2**n - 1 print(ans)