import sys sys.setrecursionlimit(2000) n = int(input()) memo = {} memo[(1, 0)] = 0 memo[(1, 1)] = 1 memo[(1, 2)] = 0 memo[(2, 0)] = 1 memo[(2, 1)] = 0 memo[(2, 2)] = 1 memo[(3, 0)] = 1 memo[(3, 1)] = 1 memo[(3, 2)] = 0 def dp(*t): if t in memo: return memo[t] else: memo[t] = dp_inner(*t) return memo[t] def dp_inner(i, k): if k == 2: return dp(i-1, 0) elif k == 1: return dp(i-1, 2) + dp(i-1, 0) else: return dp(i-1, 1) print((dp(n, 0) + dp(n, 1) + dp(n, 2)) % (10**9+7))