Calculate hamming weight with low hamming weight
J, weight 34

+/,#:a.i.


Usage - place the string to be measured in quotes at the end:

   +/,#:a.i.'+/,#:a.i.'
34


Alternatively, taking input from the keyboard (weight 54):

   +/,#:a.i.1!:1[1
hello
21