import java.util.Scanner;

/**
 * @author hll[**********]
 * @since 2023-03-18 23:37
 **/
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            System.out.println(bitCount(in.nextInt()));
        }
    }

    public static int bitCount(int i) {
        int count = i & 1;
        while (i > 0) {
            count += ((i >>= 1) & 1) == 1 ? 1 : 0;
        }
        return count;
    }
}