/**
 *  To compute the n-th power of 2. 
 *  Usage: java Alg3 <n>
 */ 

public class Alg3 {
    public static int count = 0;
    public static double power2 (int n) {
	count++;
	if (n == 0) return 1;
	return power2(n - 1) + 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);
    }
}
