#include <stdio.h> int main() { unsigned int n; int count = 0; scanf("%u", &n); while (n) { n &= (n - 1); count++; } printf("%d", count); return 0; }
Test Cases
Test Results
Input
5
Expected Output
2