import java.util.Scanner;
//考虑角度要定在末尾位置
//如果末尾是E或F,则种数为2*a(i-1);如果末尾是O,则末2位一定是EO或FO,则种数为2*a(i-2)
public class Hd2047 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int n = sc.nextInt();
long[] a = new long[40]; //注意类型越界
a[1] = 3;
a[2] = 8;
if (n >= 3) {
for (int i = 3; i < 40; i++) {
a[i] = 2 * a[i - 1] + 2 * a[i - 2];
}
}
System.out.println(a[n]);
}
}
}