#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define Would #define you const int INF = 999999999; const int MOD = 1e9 + 7; const double pi = 3.141592653589793238; long long dp[1000005][5]; int main() { long n; cin >> n; dp[1][1] = 1; for (int i = 2; i <= n; ++i) { dp[i][0] = (dp[i - 1][1] + dp[i - 1][2]) % MOD; dp[i][1] = dp[i - 1][0] % MOD; dp[i][2] = dp[i - 1][1] % MOD; } cout << (dp[n][0] + dp[n][1] + dp[n][2]) % MOD << endl; }