Skip to main content
2 of 2
Commonmark migration

CJam, 6 bytes

ri2b:+

ri         "Read the input and convert it to integer";
  2b       "Convert the integer into base 2 format";
    :+     "Sum the digits of base 2 form";

Try it online here

Optimizer
  • 26.6k
  • 7
  • 66
  • 142