import java.util.Scanner; import java.util.ArrayList; public class Bit{ public int count(int n){ int c=0; while(n > 0){ c += n % 2; n = n/2; } return c; } public int search(int n){ ArrayList list = new ArrayList<>(); ArrayList next = new ArrayList<>(); boolean[] v = new boolean[n+1]; int p = 1,ne,pre,move,res = 1; list.add(1); while(list.size()>0){ for(int i = 0;i= 1 && v[pre] == false){ v[pre] = true; next.add(pre); } } res++; list.clear(); list.addAll(next); next.clear(); } return -1; } public static void main(String[] arg){ Scanner sc = new Scanner(System.in); Bit cluc = new Bit(); int n,res; n = sc.nextInt(); res = cluc.search(n); System.out.println(res); } }