#include <iostream>
#include <string>
#include <bitset>
#include <type_traits>
#define IS_INTEGRAL(T) typename std::enable_if< std::is_integral<T>::value >::type* = 0
template<class T>
int countBits(T byte, IS_INTEGRAL(T))
{
std::bitset<sizeof(T)*8> bs(byte);
return bs.count();
}
int main()
{
unsigned int val = 1055;
std::cout << countBits(val);
return 0;
}
int countOnes(int x){
int r=0;
while(x) r+=x&1, x>>=1;
return r;
}