puts gets.chomp.to_i.to_s(2).count(?1)
-213487394123948723
30
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!