//找规律,最后得到递推公式import java.util.Scanner;public class Main {private static final int MAXN = 35;private static long dp[] = new long[MAXN];private static void init() {dp[1] = 3;dp[2] = 9;for (int i = 3; i < MAXN; i++) {dp[i] = dp[i - 1] * 2 + dp[i - 2];}}public static void main(String[] args) {Scanner cin = new Scanner(System.in);init();while (cin.hasNext()) {int n = cin.nextInt();System.out.println(dp[n]);}}}