#include using namespace std; int main() { int a, b, x, d = 0; cin >> a >> b; x = a ^ b; if (a & b != a) { cout << 0 << endl; return 0; } while (x) { d += x % 2; x /= 2; } cout << (d + 1) / 2 << endl; }