C# 38 bytes - Convert.ToString(X,2).Count(C=>C==49);