#include #include #include #include #include #include #include #include #include #include #include const int MOD = 1e9 + 7; const int iINF = 100000000; #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long int; using P = pair; using edge = struct { int to; int cost; }; ll N, dp[1000010][3]; int main() { cin >> N; dp[1][1] = 1; for (int i = 1; i < N; i++) { for (int j = 0; j < 3; j++) { if (j == 0) (dp[i + 1][1] += dp[i][0]) %= MOD; else if (j == 1) { (dp[i + 1][2] += dp[i][1]) %= MOD; (dp[i + 1][0] += dp[i][1]) %= MOD; } else (dp[i + 1][0] += dp[i][2]) %= MOD; } } ll ans = 0; rep(i, 3) (ans += dp[N][i]) %= MOD; cout << ans << endl; return 0; }