import java.util.*;
public class Main {
public static int k =0;
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int n = s.nextInt();
TOH(n,“T1”,“T2”,“T3”);
System.out.println(k);
}
public static void TOH(int n, String src, String dest, String helper) {
if (n == 0) {
return;
}
TOH(n - 1, src, helper, dest);
System.out.println("Move " + n + "th disk from " + src + " to " + dest);
k++;
TOH(n - 1, helper, dest, src);
}
}