import java.math.BigInteger;

public class Solution {

// you need to treat n as an unsigned value

public int hammingWeight(Integer m) {

BigInteger n = BigInteger.valueOf(m);

int count=0;

while(!(n == BigInteger.ZERO)){

BigInteger k = n.and(BigInteger.valueOf(1));

if(k.equals(BigInteger.valueOf(1))){

count++;

}

n.shiftLeft(1);

}

return count;

```
}
```

}