MOD = 10 ** 9 + 7 n = int(input()) if n < 4: print(0) exit() dp = [[0 for _ in range(8)] for _ in range(n)] for j in range(8): dp[2][j] = 1 for i in range(3, n): 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 ans = pow(2, n, MOD) for j in range(8): ans = (ans - dp[-1][j]) % MOD print(ans)