#include #include #include #include #include #include #include using namespace std; using ll = long long; const ll INF = 1e9; const ll MOD = 1e9 + 7; ll dp[1000010][3]; int main() { int N; cin >> N; dp[0][0] = 1; for (int i = 0; i < N; i++) { dp[i+1][0] = (dp[i][1] + dp[i][2]) % MOD; // パー dp[i+1][1] = dp[i][0] % MOD; // ケン dp[i+1][2] = dp[i][1] % MOD; // ケン2回目 } cout << (dp[N][0] + dp[N][1] + dp[N][2]) % MOD << endl; return 0; }