import java.util.*; public class Main{ public static void main(String[] args){ Scanner scanner = new Scanner(System.in); while(scanner.hasNext()){ HashMap<Character, Integer> map = new HashMap<>(); int a = scanner.nextInt(); String Octal = Integer.toBinaryString(a); char[] chars = Octal.toCharArray(); for(char cha: chars){ if(map.containsKey(cha)){ map.put(cha, map.get(cha)+1); }else{ map.put(cha, 1); } } //字符'1' System.out.println(map.get('1')); } scanner.close(); } }