import java.util.*;
public class Main {
public static int countDif(int m, int n) {
int cnt = 0;
while(m != 0 || n != 0) {
if((m & 1) != (n & 1)) {
cnt++;
}
m >>= 1;
n >>= 1;
}
return cnt;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int m = sc.nextInt();
int n = sc.nextInt();
System.out.println(countDif(m, n));
}
}