from enum import IntEnum, auto # ステート遷移 class E(IntEnum): S = 0 # 開始 K = auto() # ケン KK = auto() # ケンケン P = auto() # パ def nexts(self): match self: case E.S: return [E.K] case E.K: return [E.KK, E.P] case E.KK: return [E.P] case E.P: return [E.K] assert False @staticmethod def states(): for fm in E: for to in fm.nexts(): yield fm, to MOD = 10 ** 9 + 7 N = int(input()) dp = [[0] * len(E) for _ in range(N+1)] dp[0][E.S] = 1 for i in range(N): for fm in E: if dp[i][fm] == 0: continue for to in fm.nexts(): dp[i+1][to] += dp[i][fm] dp[i+1][to] %= MOD ans = sum(dp[N]) % MOD print(ans)