/**
 * To compute the n-th power of 2. 
 * Usage: java Alg2 <n>
 */
public class Alg2 {
    public static int count = 0;
    public static double power2 (int n) {
	count++;
	if (n == 0) return 1;
	return 2 * power2(n - 1);
    }

    public static void main(String[] args) {
	int n = Integer.parseInt(args[0]);
	System.out.println("2^" + n + " = " + power2(n));
	System.out.println("Number of times power2 was called = " + count);
    }
}
