N = int(input()) mod = int(1e9) + 7 dp = [[0, 0, 0] for _ in range(N+1)] for i in range(1, N+1): if i >= 1: dp[i][0] = (dp[i-1][1] + dp[i-1][2] + (i==1)) % mod if i >= 2: dp[i][1] = (dp[i-2][2] + dp[i-2][0] + (i==2)) % mod if i >= 3: dp[i][2] = (dp[i-3][0] + dp[i-3][1] + (i==3)) % mod print(sum(dp[N]) % mod)