def muzyun(A,B): while A: if A & 1 == 1 and B & 1 !=1: return True A >>= 1 B >>= 1 return False A, B = map(int,input().split()) if muzyun(A,B): print(0) exit() ans = 0 C = A^B while C: if C & 1 == 1: ans+=1 C >>= 1 print(max(1,ans))