import java.util.Scanner;

public class Demo11
{
    public static int c = 0;  // Counts # recursive method has been called

    public static void main(String[] argv)
    {
	Scanner in = new Scanner(System.in);

	int[] A = null;  // Fake array

	System.out.print("Enter n = ");
	int n = in.nextInt();

	recurse(A, 0, n);

	System.out.println("Runtime complexity = " + c);
	System.out.println("2n - 1 = " + (2*n - 1) );
    }

    public static void recurse(int[] A, int a, int b)
    {
//	System.out.println("a = " + a + " b = " + b);

        if ( b-a <= 1 )
	{  
	   c++;		// Simulate doPrimitive by
                        // keep track of # doPrimitive() executed
           return;
        }
        else
        {
	   c++;	// Keep track of # doPrimitive() executed
           recurse(A, a, (a+b)/2 );
           recurse(A, (a+b)/2, b);
        }
    }
}