#include<iostream>
using namespace std;
int main()
{
int a, b;
while (cin >> a >> b)
{
int count = 0;
int c = a^b;
while (c)
{
c &= c - 1;
count++;
}
cout << count << endl;
}
cin.get();
return 0;
}
using namespace std;
int main()
{
int a, b;
while (cin >> a >> b)
{
int count = 0;
int c = a^b;
while (c)
{
c &= c - 1;
count++;
}
cout << count << endl;
}
cin.get();
return 0;
}