#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include using namespace std; #define REP(i,n) for(int i=0;(i)<(n);(i)++) #define ll long long static const ll MOD = 1000000007; ll dp[3][1000006];//ケンケン,ケンパ,パケンの3パターン×N int main() { ll N; cin >> N; dp[0][1] = 0; dp[1][1] = 0; dp[2][1] = 1; for (int i = 2;i <= N;i++) { dp[0][i] = dp[2][i - 1] % MOD; dp[1][i] = ( dp[0][i - 1] + dp[2][i - 1] ) % MOD; dp[2][i] = dp[1][i - 1] % MOD; } ll ans = ( dp[0][N] + dp[1][N] + dp[2][N] ) % MOD; cout << ans << endl; //return 0; }