import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        // 入力
        String sss = sc.next();
        // 出力
        int val = Integer.parseInt(sss);
        int len = sss.length();
        int num = 0;
        for (int i = 0; i < len; i++) {
            num += val & 0x01;
            val >>= 1;
        }
        System.out.println(num);
        sc.close();
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        // 入力
        String sss = sc.next();
        // 出力
        int val = Integer.parseInt(sss);
        int len = sss.length();
        int num = 0;
        for (int i = 0; i < len; i++) {
            num += val & 0x01;
            val >>= 1;
        }
        System.out.println(num);
        sc.close();
    }
} Main public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        // 入力
        String sss = sc.next();
        // 出力
        int val = Integer.parseInt(sss);
        int len = sss.length();
        int num = 0;
        for (int i = 0; i < len; i++) {
            num += val & 0x01;
            val >>= 1;
        }
        System.out.println(num);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        // 入力
        String sss = sc.next();
        // 出力
        int val = Integer.parseInt(sss);
        int len = sss.length();
        int num = 0;
        for (int i = 0; i < len; i++) {
            num += val & 0x01;
            val >>= 1;
        }
        System.out.println(num);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String sss = sc.next(); sss sc.next() sc.next sc int val = Integer.parseInt(sss); val Integer.parseInt(sss) Integer.parseInt Integer sss int len = sss.length(); len sss.length() sss.length sss int num = 0; num 0 for (int i = 0; i < len; i++) {
            num += val & 0x01;
            val >>= 1;
        } int i = 0; int i = 0; i 0 i < len i len i++ i++ i {
            num += val & 0x01;
            val >>= 1;
        } {
            num += val & 0x01;
            val >>= 1;
        } num += val & 0x01 num val & 0x01 val 0x01 val >>= 1 val 1 System.out.println(num) System.out.println System.out System System.out num sc.close() sc.close sc String args[] args public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        // 入力
        String sss = sc.next();
        // 出力
        int val = Integer.parseInt(sss);
        int len = sss.length();
        int num = 0;
        for (int i = 0; i < len; i++) {
            num += val & 0x01;
            val >>= 1;
        }
        System.out.println(num);
        sc.close();
    }
} public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        // 入力
        String sss = sc.next();
        // 出力
        int val = Integer.parseInt(sss);
        int len = sss.length();
        int num = 0;
        for (int i = 0; i < len; i++) {
            num += val & 0x01;
            val >>= 1;
        }
        System.out.println(num);
        sc.close();
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        // 入力
        String sss = sc.next();
        // 出力
        int val = Integer.parseInt(sss);
        int len = sss.length();
        int num = 0;
        for (int i = 0; i < len; i++) {
            num += val & 0x01;
            val >>= 1;
        }
        System.out.println(num);
        sc.close();
    }
}
