ENH Add count_binary1s function