"""

2進数表記に 1010を含む


"""

N = int(input())

mod = 10**9+7

dp = [1,0,0,0]

for i in range(N):

    ndp = [0,0,0,0]

    #ok
    ndp[1] += dp[0] #1を置く
    ndp[0] += dp[0] #0

    #1
    ndp[1] += dp[1] #1を置く
    ndp[2] += dp[1] #0

    #2 = 10
    ndp[3] += dp[2] #1
    ndp[0] += dp[2] #0

    #3 = 101
    ndp[1] += dp[3] #1
    #0は禁止

    for j in range(4):
        ndp[j] %= mod
    dp = ndp

ng = sum(dp) % mod

ans = pow(2,N,mod) - ng
print (ans % mod)