#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int i=0; i=b; --i) #define ALL(c) (c).begin(), (c).end() typedef long long ll; typedef vector VI; typedef vector VL; typedef vector VVI; typedef pair P; typedef pair PL; const ll mod = 1e9 + 7; ll dp[1000010][4]; int main() { int n; cin >> n; dp[0][0] = 1; REP(i,n) REP(j,4){ FOR(k,1,3){ if (k == j) continue; dp[i+k][k] = (dp[i+k][k] + dp[i][j]) % mod; } } ll ans = 0; FOR(j,1,3) ans = (ans + dp[n][j]) % mod; cout << ans << endl; return 0; }