x = int(input()) y = int(input()) counter = 0 while (x or y): counter += (x % 2)^(y % 2) x >>= 1 y >>= 1 print(counter)