class Solution(object):
def hammingDistance(self, x, y):
"""
:type x: int
:type y: int
:rtype: int
"""
ans = 0
z = x ^ y
while z > 0:
if z % 2 == 1:
ans += 1
z = (z-1)/2
else:
z /= 2
return anshamming distance