/**
 * Created by IntelliJ IDEA.
 * User: m09cke
 * Date: 18.11.2009
 * Time: 17:07:50
 * To change this template use File | Settings | File Templates.
 */
import java.lang.*;
import java.io.*;
import java.util.Arrays;
import java.util.Scanner;

/*public class Main implements Runnable{

   public void run(){
       try{
           StreamTokenizer in = new StreamTokenizer( new BufferedReader( new FileReader( new File( "ship.in"))));
           PrintStream out = new PrintStream(new File("ship.out"));
           in.nextToken();
           int n = (int)in.nval;
           in.nextToken();
           int k = (int)in.nval;
           in.nextToken();
           int p = (int)in.nval;
           int count = 0;
           boolean t = true;
           Array[] a =  new int[k];
           for (int i=0; i<n; i++){
               if (t){
                   in.nextToken();
                   if (in.sval.charAt(0)=='-'){

                   }
               }
           }
       }
       catch(Exception e){
           e.printStackTrace();
           System.exit(1);
       }
   }

   public static void main(String[] args){
       new Thread(new Main()).start();
   }

}*/
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

public class Main{

    public static void main(String[] args) throws IOException{
                    //StreamTokenizer in = new StreamTokenizer( new BufferedReader( new FileReader( new File( "drakes.in"))));
                    PrintStream out = new PrintStream(new File("drakes.out"));
                    //in.nextToken();
                    Scanner i = new Scanner(new File("drakes.in"));
                    //long n = (long)in.nval;
                    long n = i.nextLong();
                    long c = 0;
                    if (n==0){
                        out.println(0);
                    }
                    else{
                        while  (n!=1){
                            if (n%2==0){
                                n=n/2;
                            }
                            else{
                                c++;
                                n=(n-1)/2;
                            }
                        }
                        c++;
                        out.println(c);
                    }
                    out.close();

    }

}


