import java.util.*; public class Yukicoder_47{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); int N = stdIn.nextInt(); boolean flag = true; if(N==1){ System.out.println(0); } else{ String str = Integer.toBinaryString(N); int count = str.length(); for(int i=1;i