import java.io.*; import java.util.*; public class Main { static final int MOD = 1000000007; public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); if (n <= 3) { System.out.println(0); return; } int[][] dp = new int[n + 1][8]; Arrays.fill(dp[3], 1); for (int i = 4; i <= n; i++) { dp[i][0] = (dp[i - 1][0] + dp[i - 1][4]) % MOD; dp[i][1] = (dp[i - 1][0] + dp[i - 1][4]) % MOD; dp[i][2] = dp[i - 1][1]; dp[i][3] = (dp[i - 1][1] + dp[i - 1][5]) % MOD; dp[i][4] = (dp[i - 1][2] + dp[i - 1][6]) % MOD; dp[i][5] = (dp[i - 1][2] + dp[i - 1][6]) % MOD; dp[i][6] = (dp[i - 1][3] + dp[i - 1][7]) % MOD; dp[i][7] = (dp[i - 1][3] + dp[i - 1][7]) % MOD; } int total = 0; for (int x : dp[n]) { total += x; total %= MOD; } long ans = (pow(2, n) - total + MOD) % MOD; System.out.println(ans); } static long pow(long x, int p) { if (p == 0) { return 1; } else if (p % 2 == 0) { return pow(x * x % MOD, p / 2); } else { return pow(x, p - 1) * x % MOD; } } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public String next() throws Exception { if (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }