Slightly simpler:
```
return (x & y).sum()
```