# -*- coding:utf-8 -*-
class Transform:
    def calcCost(self, A, B):
        # write code here
        a = A ^ B
        count = 0
        while a:
            a &= (a-1)
            count += 1
        return count