import java.util.*; public class Main{ public static void main(String[] arg){ Scanner s=new Scanner(System.in); while(s.hasNext()){ Integer inputInteger=s.nextInt(); int count=0; while(inputInteger!=0){ inputInteger^=inputInteger&((~inputInteger)+1); count++; } System.out.println(count); } } }